#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

struct DATA{
  int Number;
  double Time;
};

bool compare(const DATA&, const DATA&);

int main(){
  int i, j, number;
  double time;
  DATA person;
  vector<DATA> data, win, lose;

  for(i=0; i<3; ++i){
    for(j=0; j<8; ++j){
      cin >> number >> time;
      person.Number = number;
      person.Time = time;
      data.push_back(person);
    }

    sort(data.begin(), data.end(), compare);
    win.push_back(data[0]);
    win.push_back(data[1]);

    for(j=2; j<8; ++j)
      lose.push_back(data[j]);

    data.clear();
  }

  sort(lose.begin(), lose.end(), compare);

  win.push_back(lose[0]);
  win.push_back(lose[1]);

  for(i=0; i<win.size(); ++i){
    cout << win[i].Number << " ";
    cout.setf(ios::fixed, ios::floatfield);
    cout.precision(2);
    cout << win[i].Time << endl;
  }

  return 0;
}

bool compare(const DATA& x, const DATA& y){
  return x.Time < y.Time;
}