#include <bits/stdc++.h>
using namespace std;
typedef pair<double, int> P;
vector<P> v[4];

int main() {
	for (int i = 0; i != 24; ++i) {
		int n;
		double t;
		cin >> n >> t;
		v[i / 8].push_back(P(t, n));
	}
	for (int i = 0; i != 3; ++i)
		sort(v[i].begin(), v[i].end());

	for (int i = 0; i != 3; ++i)
		for (int j = 2; j != 8; ++j)
			v[3].push_back(v[i][j]);

	sort(v[3].begin(), v[3].end());

	for (int i = 0; i != 4; ++i)
		for (int j = 0; j != 2; ++j)
			cout << v[i][j].second << ' ' << fixed << setprecision(2)
					<< v[i][j].first << endl;

	return 0;
}