#include<string>
#include<iostream>
#include<map>
using namespace std;
int main() {
	map<double, int>d;
	for (int i = 0; i < 3; i++) {
		map<double, int>a;
		int b;
		double c;
		for (int j = 0; j < 8; j++) {
			cin >> b >> c;
			a.insert(map<double, int>::value_type(c, b));
		}
		map<double, int>::iterator it = a.begin();
		cout << (*it).second << " " << (*it).first << endl;
		it++;
		cout << (*it).second << " " << (*it).first << endl;
		it++;
		d.insert(map<double, int>::value_type((*it).first, (*it).second));
	}
	map<double, int>::iterator it = d.begin();
	cout << (*it).second << " " << (*it).first << endl;
	it++;
	cout << (*it).second << " " << (*it).first << endl;
	it++; 
}