#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>
#include<complex>

#define f first
#define s second
#define mp make_pair

#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()

using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef complex<double> P;

int main(){
  vector<pair<double,int> > vv(18);
  REP(i,3){
    vector<pair<double,int> > v(8);
    REP(j,8)
      cin>>v[j].s>>v[j].f;
    sort(v.begin(),v.end());
    REP(j,6) vv[i*6 + j] = v[j+2];
    printf("%d %.2f\n",v[0].s,v[0].f);
    printf("%d %.2f\n",v[1].s,v[1].f);
  }
  sort(vv.begin(),vv.end());
  printf("%d %.2f\n",vv[0].s,vv[0].f);
  printf("%d %.2f\n",vv[1].s,vv[1].f);
  return 0;
}