#include <bits/stdc++.h>

using namespace std;

class PlayerData {
public:
	int num;
	double time;
};

PlayerData Player[24];


void show(int start) {
	cout << Player[start].num << " " << fixed << setprecision(2) << Player[start].time << endl;
	cout << Player[start + 1].num << " " << fixed << setprecision(2) << Player[start + 1].time << endl;
	Player[start].time = Player[start + 1].time = 101;
}

bool compere(const PlayerData& p1, const PlayerData& p2) {
	return p1.time < p2.time;
}

int main(void) {
	int start, end;

	for (int i = 0; i < 24; i++) {
		cin >> Player[i].num >> Player[i].time;

	}

	end = 0;
	for (int i = 0; i < 3; i++) {
		start = end;
		end += 8;
		sort(Player + start, Player + end, compere);
		show(start);
	}

	start = 0;
	sort(Player + start, Player + end, compere);
	show(start);


	return 0;
}
