#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

int main() {
  vector<pair<double,int> > vv;
  REP(k,3) {
    vector<pair<double,int> > v;
    REP(i,8) {
      int n;
      double t;
      cin >> n >> t;
      v.push_back(make_pair(t,n));
    }
    sort(ALL(v));
    REP(i,2)
      printf("%d %.2f\n",v[i].second,v[i].first);
    for(int i=2;i<8;i++)
      vv.push_back(v[i]);
  }
  sort(ALL(vv));
  REP(i,2)
    printf("%d %.2f\n",vv[i].second,vv[i].first);
}