#include <bits/stdc++.h>
using namespace std;
int main(void){
    std::map<double, int> map4;
    int p;
    double t;
    std::map<double, int> map1;
    for (int i=0;i<8;i++) {
        cin>>p>>t;
        map1.insert(make_pair(t,p));
    }
    auto itr1=map1.begin();
    printf("%d",itr1->second);
    cout<<" ";
    printf("%.2f",itr1->first);
    cout<<endl;
    itr1=next(itr1,1);
    printf("%d",itr1->second);
    cout<<" ";
    printf("%.2f",itr1->first);
    cout<<endl;
    
    
    std::map<double, int> map2;
    for (int j=0;j<8;j++) {
        cin>>p>>t;
        map2.insert(make_pair(t,p));
    }
    auto itr2=map2.begin();
    printf("%d",itr2->second);
    cout<<" ";
    printf("%.2f",itr2->first);
    cout<<endl;
    itr2=next(itr2,1);
    printf("%d",itr2->second);
    cout<<" ";
    printf("%.2f",itr2->first);
    cout<<endl;
    
    
    std::map<double, int> map3;
    for (int j=0;j<8;j++) {
        cin>>p>>t;
        map3.insert(make_pair(t,p));
    }
    auto itr3=map3.begin();
    printf("%d",itr3->second);
    cout<<" ";
    printf("%.2f",itr3->first);
    cout<<endl;
    itr3=next(itr3,1);
    printf("%d",itr3->second);
    cout<<" ";
    printf("%.2f",itr3->first);
    cout<<endl;
    
    for (int k=0;k<6;k++) {
        itr1=next(itr1,1);
        map4.insert(make_pair(itr1->first,itr1->second));
        itr2=next(itr2,1);
        map4.insert(make_pair(itr2->first,itr2->second));
        itr3=next(itr3,1);
        map4.insert(make_pair(itr3->first,itr3->second));
    }
    
    auto itr4=map4.begin();
    printf("%d",itr4->second);
    cout<<" ";
    printf("%.2f",itr4->first);
    cout<<endl;
    itr4=next(itr4,1);
    printf("%d",itr4->second);
    cout<<" ";
    printf("%.2f",itr4->first);
    cout<<endl;
}
