#include<iostream>
#include<iomanip>  
using namespace std;
struct player{
  int id;
  double time;
};
player pk[4];
player ph[2];
void top4(player a){
  if(a.time<pk[3].time||pk[3].time==0) pk[3] = a;
}
void top3(player a){
  top4(a);
  if(a.time<pk[2].time||pk[2].time==0){
    pk[3] = pk[2];
    pk[2] = a;
  }
}
void top2(player a){
  top3(a);
  if(a.time<pk[1].time||pk[1].time==0){
    pk[2] = pk[1];
    pk[1] = a;
  }
}
void top(player a){
  top2(a);
  if(a.time<pk[0].time||pk[0].time==0){
    pk[1] = pk[0];
    pk[0] = a;
  }
}
void phtop2(player a){
  if(a.time<ph[1].time||ph[1].time==0) ph[1] = a;
}
void phtop(player a){
  phtop2(a);
  if(a.time<ph[0].time||ph[0].time==0){
    ph[1] = ph[0];
    ph[0] = a;
  }
}
int main(){
  player p;
  for(int i=0;i<2;i++){
      ph[i].id = 0;
      ph[i].time = 0;
  }
  for(int i=0;i<3;i++){
    for(int i=0;i<4;i++){
      pk[i].id = 0;
      pk[i].time = 0;
    }
    for(int j=0;j<8;j++){
      cin >> p.id >> p.time;
      top(p);
    }
    cout << pk[0].id << ' ';
    cout << fixed << setprecision(2) << pk[0].time << endl;
    cout << pk[1].id << ' ';
    cout << fixed << setprecision(2) << pk[1].time << endl;
    phtop(pk[2]);
    phtop(pk[3]);
  }
  cout << ph[0].id << ' ';
  cout << fixed << setprecision(2) << ph[0].time << endl;
  cout << ph[1].id << ' ';
  cout << fixed << setprecision(2) << ph[1].time << endl;
  return 0;
}