#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
#include <sstream>
#include <cstdio>
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)
#define pb push_back
#define mp make_pair
int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

vector<pair<int,double> > other;
int main(void){
  rep(i,3){
    vector<pair<double,int> > timer;
    rep(i,8){
      int n;double t;
      cin>>n>>t;
      timer.pb(mp(t,n));
    }
    sort(all(timer));
    cout<<timer[0].second << " " << timer[0].first<<endl;
    cout<<timer[1].second << " " << timer[1].first<<endl;
    loop(i,2,timer.size()){
      other.push_back(timer[i]);
    }
    timer.clear();
  }
  sort(all(other));
  cout<<other[0].second << " " << other[0].first<<endl;
  cout<<other[1].second << " " << other[1].first<<endl;

}