#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main() {
    int t,n,i,b[101],d[101];
    
    cin >> t;
    while(t--){
        cin >> n;
        for(i=0;i<n;i++){
            cin >> b[i] >> d[i];
            }
             if(n<10){
                cout << "MOREPROBLEMS" << endl;
            }
        else {
                sort(d,d+n);
        for(i=0;i<n;i++){
            cout << d[i] << endl;
        }
        }
        
    }
    
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: