#include<algorithm>
#include<iostream>
#include<iomanip>
#include<vector>

typedef std::pair<double, int> P;
std::vector<P> v[4];

int main()
{
	for( int i = 0; i != 24; ++i )
	{
		int n;
		double t;
		std::cin >> n >> t;

		v[i/8].push_back( P( t, n ) );
	}

	for( int i = 0; i != 3; ++i )
		std::sort( v[i].begin(), v[i].end() );

	for( int i = 0; i != 3; ++i )
		for( int j = 2; j != 8; ++j )
			v[3].push_back( v[i][j] );

	std::sort( v[3].begin(), v[3].end() );

	for( int i = 0; i != 4; ++i )
		for( int j = 0; j != 2; ++j )
			std::cout << v[i][j].second << ' ' << std::fixed << std::setprecision( 2 ) << v[i][j].first << std::endl;

	return 0;
}