#include<iostream>
#include<iomanip>
using namespace std;

struct man{
	int no;
	double time;
};

man p[24];
man hk[6];

void solve(){
	man tmp;
	for(int i=0; i<7; i++){
		if(p[i].time > p[i+1].time){
			tmp = p[i];
			p[i] = p[i+1];
			p[i+1] = tmp;
			i=-1;
		}
	}
	for(int i=8; i<15; i++){
		if(p[i].time > p[i+1].time){
			tmp = p[i];
			p[i] = p[i+1];
			p[i+1] = tmp;
			i=7;
		}
	}
	for(int i=16; i<23; i++){
		if(p[i].time > p[i+1].time){
			tmp = p[i];
			p[i] = p[i+1];
			p[i+1] = tmp;
			i=15;
		}
	}
	hk[0] = p[3];
	hk[1] = p[4];
	hk[2] = p[10];
	hk[3] = p[11];
	hk[4] = p[18];
	hk[5] = p[19];
	for(int i=0; i<5; i++){
		if(hk[i].time > hk[i+1].time){
			tmp = hk[i];
			hk[i] = hk[i+1];
			hk[i+1] = tmp;
			i=-1;
		}
	}
}

int main(){
	for(int i=0; i<24; i++)
		cin >> p[i].no >> p[i].time;
	solve();
	cout << p[0].no << ' ' << setprecision(2) << fixed << p[0].time << endl;
	cout << p[1].no << ' ' << setprecision(2) << fixed << p[1].time << endl;
	cout << p[8].no << ' ' << setprecision(2) << fixed << p[8].time << endl;
	cout << p[9].no << ' ' << setprecision(2) << fixed << p[9].time << endl;
	cout << p[16].no << ' ' << setprecision(2) << fixed << p[16].time << endl;
	cout << p[17].no << ' ' << setprecision(2) << fixed << p[17].time << endl;
	cout << hk[0].no << ' ' << setprecision(2) << fixed << hk[0].time << endl;
	cout << hk[1].no << ' ' << setprecision(2) << fixed << hk[1].time << endl;
}