#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstdio>
#define EPS 1e-10
#define F first
#define S second
using namespace std;
typedef pair<int,double> P;

bool cmp(const P &p,const P &q){
  if(!(fabs(p.S-q.S)<=EPS))return p.S < q.S;
  return p.F > q.F;
}


int main(){
  P info[24];
  bool used[24];
  for(int i=0;i<24;i++){cin >> info[i].F >> info[i].S;used[i] = false;}
  sort(info,info+7,cmp);
  printf("%d %.2f\n",info[0].F,info[0].S);used[info[1].F] = true;
  printf("%d %.2f\n",info[1].F,info[1].S);used[info[0].F] = true;
  sort(info+8,info+15,cmp);
  printf("%d %.2f\n",info[8].F,info[8].S); used[info[8].F] = true;
  printf("%d %.2f\n",info[9].F,info[9].S); used[info[9].F] = true;
  sort(info+16,info+23,cmp);
  printf("%d %.2f\n",info[16].F,info[16].S); used[info[16].F] = true;
  printf("%d %.2f\n",info[17].F,info[17].S); used[info[17].F] = true;
  sort(info,info+23,cmp);
  int cnt = 0;
  for(int i=0;i<24;i++){
    if(!used[info[i].F]){
      cnt++;
      printf("%d %.2f\n",info[i].F,info[i].S);
    }
    if(cnt == 2)break;
  }

}