#include <bits/stdc++.h>
using namespace std;

using P = pair<double, int>;

int main()
{
	cout << fixed << setprecision(2);
	vector<int> p(8);
	vector<double> t(8);
	set<P> s;
	for (int j = 0; j < 3; j++) {
		int n1, n2;
		double t1 = 1000, t2 = 1000;
		for (int i = 0; i < 8; i++) {
			cin >> p[i] >> t[i];
			s.insert((P(t[i], p[i])));
			if (t1 > t[i]) {
				t2 = t1;
				n2 = n1;
				t1 = t[i];
				n1 = i;
			}
			else if (t2 > t[i]) {
				t2 = t[i];
				n2 = i;
			}
		}
		cout << p[n1] << ' ' << t[n1] << endl;
		cout << p[n2] << ' ' << t[n2] << endl;
		s.erase(P(t[n1], p[n1]));
		s.erase(P(t[n2], p[n2]));
	}
	cout << s.begin()->second << ' ' << s.begin()->first << endl;
	s.erase(s.begin());
	cout << s.begin()->second << ' ' << s.begin()->first << endl;
	return 0;
}