#include using namespace std; typedef pair P; signed main(){ int n;cin>>n; vector

v(n); while(n--){ string s,t;cin>>s>>t; v[n]=P(s,t); } sort(v.begin(),v.end()); for(P p:v)cout<