#include <iostream>
#include <algorithm>
#include <cstdio>
struct athlete{int num; double time;};

bool tsort(const athlete& l, const athlete& r){
	return l.time < r.time;
}

int main(){
	athlete a[3][8], f[3];
	for(int i=0;i<3;i++){
		for(int j=0;j<8;j++){
			int num;
			double time;
			std::cin >> num >> time;
			a[i][j].num = num, a[i][j].time = time;
		}
		std::sort(a[i],a[i]+8,tsort);

		//3ÊðÅIIlÉñ·D
		f[i] = a[i][2];
	}

	//egÌ1ÊÆ2Êð\¦
	for(int i=0;i<3;i++){
		printf("%d %.2lf\n",a[i][0].num,a[i][0].time);
		printf("%d %.2lf\n",a[i][1].num,a[i][1].time);
	}

	//egÌ3ÊæèãÊ2lðÖD
	std::sort(f,f+3,tsort);
	printf("%d %.2lf\n",f[0].num,f[0].time);
	printf("%d %.2lf\n",f[1].num,f[1].time);
}