#include <stdio.h>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
#define PB push_back
#define F first
#define S second
#define MP make_pair
int main(){
    vector<pair<double,int>> v[3],all;
    pair<double,int> temp;
    for(int i=0;i<3;i++){
        for(int j=0;j<8;j++){
            scanf("%d%lf",&temp.S,&temp.F);
            v[i].PB(temp);
        }
        sort(v[i].begin(),v[i].end());
        for(int j=0;j<2;j++)printf("%d %.2lf\n",v[i][j].S,v[i][j].F);
        for(int j=2;j<8;j++)all.PB(v[i][j]);
    }
    sort(all.begin(),all.end());
    for(int i=0;i<2;i++)printf("%d %.2lf\n",all[i].S,all[i].F);
}
