#include<bits/stdc++.h>
using namespace std;
typedef long long int lld;
typedef pair<double,int> P;

int main(){
  P player[24];
  P race[3][8];
  map<int,int> used;
  for(int i=0;i<3;i++){
    for(int j=0;j<8;j++){
      cin >> player[i*8+j].second >> player[i*8+j].first;
      race[i][j] = player[i*8+j];
    }
  }
  for(int i=0;i<3;i++){
    sort(race[i],race[i]+8);
    for(int j=0;j<2;j++){
      cout << race[i][j].second << " " << race[i][j].first << endl;;
      used[race[i][j].second] = 1;
    }
  }
  sort(player,player+24);
  int cnt=0,idx=0;
  while(cnt != 2){
    if(used[player[idx].second] == 0){
      cout << player[idx].second << " " <<  player[idx].first << endl;
      cnt++;
    }
    idx++;
  }
}