#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"


int main() {
	vector<pair< ld, int>>rests;
	cout << fixed << setprecision(2);
	for (int i = 0; i < 3; ++i) {
		vector<pair< ld,int>>ps;
		for (int j = 0; j < 8; ++j) {
			int a; ld b; cin >> a >> b;
			ps.emplace_back(b, a);
		}
		sort(ps.begin(), ps.end());
		for (int j = 0; j < 2; ++j) {
			
			cout << ps[j].second << " " << ps[j].first << endl;
		}
		for (int j = 2; j < 4; ++j) {
			rests.emplace_back(ps[j]);
		}
	}
	sort(rests.begin(), rests.end());
	for (int i = 0; i < 2; ++i) {
		cout << rests[i].second << " " << rests[i].first << endl;
	}
	return 0;
}