#include <iostream>
#include <functional>
#include <vector>
#include <cstdio>

using namespace std;

class Player{
public:
	int number;
	double time;
	
	Player(){
		number = 0;
		time = 0;
	}
	
	bool operator<( const Player& lhs ) const{
		return time < lhs.time;
	}
	bool operator>( const Player& lhs ) const{
		return time > lhs.time;
	}
};

int main(int argc, char const* argv[])
{
	vector<Player> race1( 8 );
	vector<Player> race2( 8 );
	vector<Player> race3( 8 );
	vector<Player> race( 18 );

	for( int i = 0;i < 8;i++ ){
		cin >> race1[i].number;
		cin >> race1[i].time;
	}
	for( int i = 0;i < 8;i++ ){
		cin >> race2[i].number;
		cin >> race2[i].time;
	}
	for( int i = 0;i < 8;i++ ){
		cin >> race3[i].number;
		cin >> race3[i].time;
	}

	sort( race1.begin(), race1.end(), greater<Player>() );

	printf("%d %.2f\n",race1[7].number, race1[7].time );
	printf("%d %.2f\n",race1[6].number, race1[6].time );
	race1.pop_back();
	race1.pop_back();

	sort( race2.begin(), race2.end() , greater<Player>());

	printf("%d %.2f\n",race2[7].number, race2[7].time );
	printf("%d %.2f\n",race2[6].number, race2[6].time );

	race2.pop_back();
	race2.pop_back();
	sort( race3.begin(), race3.end(), greater<Player>() );

	printf("%d %.2f\n",race3[7].number, race3[7].time );
	printf("%d %.2f\n",race3[6].number, race3[6].time );
	race3.pop_back();
	race3.pop_back();

	for( int i = 0;i < 6;i++ ){
		race[i] = race1[i];
		race[i + 6] = race2[i];
		race[i + 12] = race3[i];
	}

	sort( race.begin(), race.end(), greater<Player>() );

	
	printf("%d %.2f\n",race[17].number, race[17].time );
	printf("%d %.2f\n",race[16].number, race[16].time );
	return 0;
}