#include<cstdio>
#include<vector>
#include<algorithm>

using namespace std;

int main()
{
	vector< pair<double,int> > v[3];

	for(int i=0;i<24;i++){
		int id;
		double tm;
		scanf("%d%lf",&id,&tm);
		v[i/8].push_back(make_pair(tm,id));
	}

	vector< pair<double,int> >	rem;
	for(int i=0;i<3;i++){
		sort(v[i].begin(),v[i].end());
		printf("%d %.2f\n",v[i][0].second,v[i][0].first);
		printf("%d %.2f\n",v[i][1].second,v[i][1].first);
		v[i].erase(v[i].begin());
		v[i].erase(v[i].begin());
		rem.insert(rem.begin(),v[i].begin(),v[i].end());
	}

	sort(rem.begin(),rem.end());
	printf("%d %.2f\n",rem[0].second,rem[0].first);
	printf("%d %.2f\n",rem[1].second,rem[1].first);

	return 0;
}