#include using namespace std; main(){ int N; cin >> N; pair v[N]; for(auto&i : v)cin >> i.first >> i.second; sort(v, v + N); for(auto&i : v)cout << i.first << " " << i.second << endl; }