#include int N,i;using namespace std;int main(){cin>>N;pairv[N];while(cin>>v[i].first>>v[i++].second);sort(v,v+N);for(i=0;i