#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef pair<double,int> P;
static const double EPS = 1e-5;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)

int main(void){
  vector<P> d1;
  vector<P> d2;
  REP(i,8){
    double a;int b;
    cin>>b>>a;
    d1.push_back(P(a,b));
  }
  sort(d1.begin(),d1.end());
  REP(i,8){
    if(i<2){
      printf("%d %.2lf\n",d1[i].second,d1[i].first); 
    }else{
      d2.push_back(d1[i]);
    }
  }
  d1.clear();
  REP(i,8){
    double a;int b;
    cin>>b>>a;
    d1.push_back(P(a,b));
  }
  sort(d1.begin(),d1.end());
  REP(i,8){
    if(i<2){
      printf("%d %.2lf\n",d1[i].second,d1[i].first); 
    }else{
      d2.push_back(d1[i]);
    }
  }
  d1.clear();
  REP(i,8){
    double a;int b;
    cin>>b>>a;
    d1.push_back(P(a,b));
  }
  sort(d1.begin(),d1.end());
  REP(i,8){
    if(i<2){
      printf("%d %.2lf\n",d1[i].second,d1[i].first); 
    }else{
      d2.push_back(d1[i]);
    }
  }
  sort(d2.begin(),d2.end());
  REP(i,2){
    printf("%d %.2lf\n",d2[i].second,d2[i].first); 
  }
  return 0;
}