#include<stdio.h>
#include<utility>
#include<algorithm>
#include<limits>
using namespace std;
int main()
{
	const int N1 = 3, N2=8;
	int i,j;
	pair<double,int>a[N2], w1,w2;
	w1.first = w2.first = numeric_limits<double>::max();
	for(i=0;i<N1;++i)
	{
		for(j=0;j<N2;++j)
		{
			scanf("%d %lf",&a[j].second, &a[j].first);
		}
		sort(a, a+N2);
		for(j=0;j<2;++j)
			printf("\t%d %.2f\n",a[j].second, a[j].first);
		for(j=2;j<4;++j)
		{
			if(w1.first > a[j].first)
			{
				w2=w1;
				w1=a[j];
			}
			else if(w2.first > a[j].first)
				w2 = a[j];
		}	
	}
	printf("\t%d %.2f\n"
		"\t%d %.2f\n", w1.second, w1.first, w2.second, w2.first);
	return 0;
}