#include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	int fn, sn, tn, t1n, t2n, a;
	float ft, st, tt, t1t, t2t, b;
	
	t1t = t2t = 100;
	t1n = t2n = 0;
	for(int i = 0; i < 3; i++){
		fn = sn = tn = 0;
		ft = st = tt = 1000;
		for(int j = 0; j < 8; j++){
			cin >> a >> b;
			if(b < ft){
				tt = st;
				tn = sn;
				st = ft;
				sn = fn;
				ft = b;
				fn = a;
			} else if(b < st){
				tt = st;
				tn = sn;
				st = b;
				sn = a;
			} else if(b < tt){
				tt = b;
				tn = a;
			}
		}
		cout << fn << " " << ft << endl;
		cout << sn << " " << st << endl;
		if(tt < t1t){
			t2t = t1t;
			t2n = t1n;
			t1t = tt;
			t1n = tn;
		} else if(tt < t2t){
			t2t = tt;
			t2n = tn;
		}
	}
	cout << t1n << " " << t1t << endl;
	cout << t2n << " " << t2t << endl;
	
	return 0;
}