#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
using namespace std;

int main()
{
	vector< pair< double, int > > athletes;
	vector< pair< double, int > > finalists;

	for( int i = 0; i < 3; ++i ){
		vector< pair< double, int > > party;
		for( int j = 0; j < 8; ++j ){
			int id;
			double time;
			cin >> id >> time;
			party.push_back( make_pair( time, id ) );
		}
		sort( party.begin(), party.end(), greater< pair< double, int > >() );
		finalists.push_back( party[ 7 ] );
		finalists.push_back( party[ 6 ] );
		party.pop_back();
		party.pop_back();
		athletes.insert( athletes.end(), party.begin(), party.end() );
	}
	sort( athletes.begin(), athletes.end() );
	finalists.push_back( athletes[ 0 ] );
	finalists.push_back( athletes[ 1 ] );

	for( int i = 0; i < 8; ++i ){
		cout << finalists[ i ].second << " " << fixed << setprecision( 2 ) << finalists[ i ].first << endl;
	}

	return 0;
}