#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main(void)
{
	vector< pair <double, int> > data1, data2, data3, data4;
	int num;
	double time;

	for (int i = 0; i < 8; i++){
		cin >> num >> time;
		data1.push_back(make_pair(time, num));
	}
	for (int i = 0; i < 8; i++){
		cin >> num >> time;
		data2.push_back(make_pair(time, num));
	}
	for (int i = 0; i < 8; i++){
		cin >> num >> time;
		data3.push_back(make_pair(time, num));
	}
	sort(data1.begin(), data1.end());
	sort(data2.begin(), data2.end());
	sort(data3.begin(), data3.end());
	cout << data1[0].second << " " << data1[0].first << endl;
	cout << data1[1].second << " " << data1[1].first << endl;
	cout << data2[0].second << " " << data2[0].first << endl;
	cout << data2[1].second << " " << data2[1].first << endl;
	cout << data3[0].second << " " << data3[0].first << endl;
	cout << data3[1].second << " " << data3[1].first << endl;

	for (int i = 0; i < 6; i++)
	{
		data4.push_back(data1[i+2]);
		data4.push_back(data2[i+2]);
		data4.push_back(data3[i+2]);
	}
	sort(data4.begin(), data4.end());

	cout << data4[0].second << " " << data4[0].first << endl;
	cout << data4[1].second << " " << data4[1].first << endl;

	return 0;
}