#include <cstdio>
#include <map>
using namespace std;
int main(void){
	map<int,int> remain;
	for(int i=0;i<3;++i){
		map<int,int> group;
		for(int j=0,num,p,q;j<8;++j){
			scanf("%d %d.%2d",&num,&p,&q);
			group[p*100+q]=num;
		}
		int j=0;
		for(map<int,int>::iterator it=group.begin();it!=group.end();++it){
			if(j<2) printf("%d %d.%02d\n",(*it).second,(*it).first/100,(*it).first%100);
			else remain[(*it).first] = (*it).second;
			++j;
		}
		
	}
	int i=0;
	for(map<int,int>::iterator it=remain.begin();it!=remain.end();++it){
		if(i<2) printf("%d %d.%02d\n",(*it).second,(*it).first/100,(*it).first%100);
		++i;
	}
	return 0;
}