#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <fstream>
#include <sstream>
#include <math.h>
#include <queue>
#include <stack>
#include <math.h>
#include <string.h>


struct p{
    int num;
    double time;
};

using namespace std;

bool f(p l, p r){
    return l.time<r.time;
}

int main(){
    vector<p> haisya;
    for(int roop=0; roop<3; roop++){
        vector<p> in;
        
        for(int roop2=0; roop2<8; roop2++){
            p temp;
            cin>>temp.num>>temp.time;
            in.push_back(temp);
        }
        sort(in.begin(), in.end(), f);
        cout<<in[0].num<<" "<<in[0].time<<endl;
        cout<<in[1].num<<" "<<in[1].time<<endl;
        for(int roop2=2; roop2<8; roop2++){
            haisya.push_back(in[roop2]);
        }
    }
    sort(haisya.begin(), haisya.end(), f);
    cout<<haisya[0].num<<" "<<haisya[0].time<<endl;
    cout<<haisya[1].num<<" "<<haisya[1].time<<endl;

}