#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cctype>
#include<complex>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<functional>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
using namespace std;
const int dx[] = {1,0,-1,0},dy[] = {0,1,0,-1};
#define INF 1e+8
#define rep(i,j) for(int i = 0; i < (j); i++)
#define reps(i,j,k) for(int i = j; i < k; i++)
typedef long long ll;
typedef unsigned long long ull;
int main(){
    typedef pair<double,int> P;
    priority_queue < P, vector< P >, greater< P > > hoge;
    vector < P > ans; 
    P fuga;
    int cnt = 0;
    rep(i,3){
        P p[10];
        rep(j,8){
            cin >> p[j].second >> p[j].first;
        }
        sort(p,p+8); 
        ans.push_back(p[0]);
        ans.push_back(p[1]);   
        hoge.push(p[2]);
        hoge.push(p[3]);
    }
    rep(i,6){
        cout << ans[i].second << " " << ans[i].first << endl;
    }
    fuga = hoge.top();hoge.pop();
    cout << fuga.second << " "<< fuga.first << endl; 
    fuga = hoge.top();hoge.pop();
    cout << fuga.second << " "<< fuga.first << endl;
    return 0;
}