#include<iostream>
#include<algorithm>
#include<vector>
#include<cstdio>
using namespace std;
struct ti{
long n;
double t;
} tti;
bool operator<(const ti& l,const ti& r){return l.t<r.t;}
int main(){
long f,i;
vector<ti> vt,vt2;
for(i=0;i<8;i++){cin>>tti.n>>tti.t;vt.push_back(tti);}
sort(vt.begin(),vt.end());
for(f=0,i=0;i<8;i++){
if(f<2){printf("%d %.2f\n",vt[i].n,vt[i].t);f++;}
else vt2.push_back(vt[i]);
}
vt.clear();
for(i=0;i<8;i++){cin>>tti.n>>tti.t;vt.push_back(tti);}
sort(vt.begin(),vt.end());
for(f=0,i=0;i<8;i++){
if(f<2){printf("%d %.2f\n",vt[i].n,vt[i].t);f++;}
else vt2.push_back(vt[i]);
}
vt.clear();
for(i=0;i<8;i++){cin>>tti.n>>tti.t;vt.push_back(tti);}
sort(vt.begin(),vt.end());
for(f=0,i=0;i<8;i++){
if(f<2){printf("%d %.2f\n",vt[i].n,vt[i].t);f++;}
else vt2.push_back(vt[i]);
}
sort(vt2.begin(),vt2.end());
for(f=0,i=0;i<18;i++){
if(f<2){printf("%d %.2f\n",vt2[i].n,vt2[i].t);f++;}
}
return 0;
}