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

#define MAX 24
using namespace std;
typedef pair<int,double> Rec;

bool LessRec(const Rec &a, const Rec &b){
	return a.second < b.second;
}

ostream &operator<<(ostream &os, const Rec t){
	printf("%d %.2f", t.first, t.second);
	//os << t.first << ' ' << setprecision(2) << t.second;
	return os;
}

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

	for(int i=0;i<MAX;++i)
	{
		int t;
		double time;
		cin >> t >> time;
		vPlayers.push_back( make_pair(t,time) );
	}

	sort( vPlayers.begin(), vPlayers.begin() + 8, LessRec );
	cout << vPlayers[0] << '\n' << vPlayers[1] << '\n';
	sort( vPlayers.begin() + 8, vPlayers.begin() + 16, LessRec );
	cout << vPlayers[8] << '\n' << vPlayers[9] << '\n';
	sort( vPlayers.begin() + 16, vPlayers.end(), LessRec );
	cout << vPlayers[16] << '\n' << vPlayers[17] << '\n';

	vPlayers.erase( vPlayers.begin() );
	vPlayers.erase( vPlayers.begin() );
	vPlayers.erase( vPlayers.begin()+6 );
	vPlayers.erase( vPlayers.begin()+6 );
	vPlayers.erase( vPlayers.begin()+12 );
	vPlayers.erase( vPlayers.begin()+12 );

	sort( vPlayers.begin(), vPlayers.end(), LessRec );

	cout << vPlayers[0] << '\n' << vPlayers[1] << '\n';	

	return 0;
}