#include <iostream>
#include <cstdio>
#include <utility>
#include <vector>
#include <algorithm>
using namespace std;

typedef pair<double, int> Player;

int main(void){  
  vector<Player> group[3], losers;
  
  for (int i=0; i<3; i++){
    for (int j=0; j<8; j++){
      int id;
      double tm;
      cin >> id >> tm;
      group[i].push_back(make_pair(tm, id));
    }
    sort(group[i].begin(), group[i].end());
    for (int j=0; j<8; j++){
      Player p = group[i][j];
      if (j<2){
        printf("%d %2.2f\n", p.second, p.first);
      } else {
        losers.push_back(p);
      }
    }
  }
  sort(losers.begin(), losers.end());
  for (int i=0; i<2; i++){
    Player p = losers[i];
    printf("%d %2.2f\n", p.second, p.first);
  }
  return 0;
}
