#include<bits/stdc++.h>
using namespace std;
int main()
{
vector<pair<int, string> > stu;
string s;
int n,t;
cin>>n;
for(int i = 0; i <n; ++i){
cin>>t;
cin>>s;
stu.push_back(make_pair(t,s));
}
int vis[n];
memset(vis,0,sizeof(vis));
for(int i=0; i<n/2; ++i){
cout<<stu[i].second;
for(int j = n-1; j>=n/2; j--){
if(stu[i].first ^ stu[j].first && !vis[j]){
cout<<" "<<stu[j].second<<endl;
vis[j] = 1;
break;
}
}
}
return 0;
}
网友评论