#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef long long ll;
typedef unsigned long long ull;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); i++ )
#define UREP( i, m, n ) for ( unsigned int i = (unsigned int)( m ); i < (unsigned int)( n ); i++ )

#define ITER( c ) __typeof( (c).begin() )
#define IREP( c, it ) for ( ITER(c) it = c.begin(); it != c.end(); ++it )
#define ALL( c ) (c).begin(), (c).end()
#define RALL( c ) (c).rbegin(), (c).rend()

#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define EXIST( c, e ) ( (c).find( e ) != (c).end() )

#define fst first
#define snd second

#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define DEBUG( x ) cerr << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << ( x ) << endl

int main()
{
	vector< vector< pair<double,int> > > runners( 3 );

	REP( i, 0, 3 )
	{
		runners[i].resize( 8 );

		REP( j, 0, 8 )
		{
			cin >> runners[i][j].snd >> runners[i][j].fst;
		}
	}

	vector< pair<double,int> > passed;
	vector< pair<double,int> > nokori;

	REP( i, 0, 3 )
	{
		sort( ALL( runners[i] ) );

		REP( j, 0, 8 )
		{
			if ( j < 2 )
			{
				passed.PB( runners[i][j] );
			}
			else
			{
				nokori.PB( runners[i][j] );
			}
		}
	}

	sort( ALL( nokori ) );
	passed.PB( nokori[0] );
	passed.PB( nokori[1] );

	cout.precision( 2 );

	REP( i, 0, 8 )
	{
		cout << passed[i].snd << ' ' << setiosflags( ios::fixed ) << passed[i].fst << endl;
	}

	return 0;
}