#include<iostream>
#include<cstdio>
#include<algorithm>
#include<queue>
using namespace std;

struct record{
	int num;
	double time;
};

bool operator<(const record& a, const record& b){
	return a.time < b.time;
}

int main(void){
	vector<record> rec1;
	vector<record> rec2;
	vector<record> rec3;
	vector<record> allrec;
	int i;
	record allbuf;
	
	for(i = 0; i < 8; i++){
		record buf;
		cin >>buf.num >>buf.time;
		rec1.push_back(buf);
	}
	sort(rec1.begin(), rec1.end());
	
	for(i = 0; i < 8; i++){
		record buf;
		cin >>buf.num >>buf.time;
		rec2.push_back(buf);
	}
	sort(rec2.begin(), rec2.end());
	
	for(i = 0; i < 8; i++){
		record buf;
		cin >>buf.num >>buf.time;
		rec3.push_back(buf);
	}
	sort(rec3.begin(), rec3.end());
	
	printf("%d %.2f\n", rec1[0].num, rec1[0].time);
	printf("%d %.2f\n", rec1[1].num, rec1[1].time);
	printf("%d %.2f\n", rec2[0].num, rec2[0].time);
	printf("%d %.2f\n", rec2[1].num, rec2[1].time);
	printf("%d %.2f\n", rec3[0].num, rec3[0].time);
	printf("%d %.2f\n", rec3[1].num, rec3[1].time);
	
	for(i = 2; i < 8; i++){
		allbuf = rec1[i];
		allrec.push_back(allbuf);
	}
	for(i = 2; i < 8; i++){
		allbuf = rec2[i];
		allrec.push_back(allbuf);
	}
	for(i = 2; i < 8; i++){
		allbuf = rec3[i];
		allrec.push_back(allbuf);
	}
	sort(allrec.begin(), allrec.end());
	
	printf("%d %.2f\n", allrec[0].num, allrec[0].time);
	printf("%d %.2f\n", allrec[1].num, allrec[1].time);
	
	return 0;
}