#include <iostream>
#include <algorithm>

struct Player {
	int id;
	float time;
	Player() {}
	Player(int id, float time) : id(id), time(time) {}
};
bool operator < (const Player& p1, const Player& p2) { return p1.time < p2.time; }

int main()
{
	Player reserve[6];
	for (int group=0; group<3; group++) {
		Player players[8];
		for (int i=0; i<8; i++) {
			int id;
			float time;
			std::cin >> id >> time;
			players[i] = Player(id, time);
		}
		std::sort(players, players + 8);
		std::cout << players[0].id << " " << players[0].time << std::endl;
		std::cout << players[1].id << " " << players[1].time << std::endl;
		reserve[2*group] = players[2];
		reserve[2*group + 1] = players[3];
	}
	std::sort(reserve, reserve + 6);
	std::cout << reserve[0].id << " " << reserve[0].time << std::endl;
	std::cout << reserve[1].id << " " << reserve[1].time << std::endl;
	
	return 0;
}


