#include<iostream>
#include<algorithm>
using namespace std;
int main() {
	typedef pair<double, int> p;
	p a[9], b[9], c[9], d[20];
	for (int i = 0; i < 8; i++)cin >> a[i].second >> a[i].first;
	for (int i = 0; i < 8; i++)cin >> b[i].second >> b[i].first;
	for (int i = 0; i < 8; i++)cin >> c[i].second >> c[i].first;
	sort(a, a + 8); sort(b, b + 8); sort(c, c + 8);
	int k = 0;
	for (int i = 2; i < 4; i++) {
		d[k] = a[i]; k++;
		d[k] = b[i]; k++;
		d[k] = c[i]; k++;
	}
	sort(d, d + 6);
	cout << a[0].second << ' ' << a[0].first << endl;
	cout << a[1].second << ' ' << a[1].first << endl;
	cout << b[0].second << ' ' << b[0].first << endl;
	cout << b[1].second << ' ' << b[1].first << endl;
	cout << c[0].second << ' ' << c[0].first << endl;
	cout << c[1].second << ' ' << c[1].first << endl;
	cout << d[0].second << ' ' << d[0].first << endl;
	cout << d[1].second << ' ' << d[1].first << endl;
	char ch; cin >> ch;
}