#include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair P; #define fi first #define se second #define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++) #define rep(i,n) repl(i,0,n) #define all(x) (x).begin(),(x).end() #define dbg(x) cout<<#x"="<y?x:y) #define mmin(x,y) (x bs; int main(){ cin.tie(0); ios::sync_with_stdio(false); cin>>n; rep(i,n){ string a,b; cin>>a>>b; bs.push_back(P(a,b)); } sort(all(bs)); rep(i,n){ cout<