#include<bits/stdc++.h>
using namespace std;

#define pb push_back
#define fr first
#define sc second
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<int,pii> pip; 
const int INF = (1<<25);
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main() {

  map<double, int> group[3];
  map<double, int> all;

  for(int i=0; i<3; i++) {
    for(int j=0; j<8; j++) {
      int num; double time;
      cin>> num>> time;
      group[i][time] = num;
    }

    map<double, int>::iterator it = group[i].begin();
    cout<< (*it).sc<< " "<< (*it).fr<< endl; it++;
    cout<< (*it).sc<< " "<< (*it).fr<< endl;

    int n=6;
    while(n--) {
      it++;
      all[(*it).fr] = (*it).sc;
    }
  }

  map<double, int>::iterator it = all.begin();
  cout<< (*it).sc<< " "<< (*it).fr<< endl; it++;
  cout<< (*it).sc<< " "<< (*it).fr<< endl;
}