#include<iostream>
#include<fstream>
#include<sstream>
#include<cstdio>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstring>
#include<cstdlib>
#include<climits>
#include<utility>
#include<cctype>
using namespace std;

#define ull unsigned long long
#define ll long long
#define stt(it,order) sort(it.begin(),it.end(),order)
#define st(it) sort(it.begin(),it.end())
#define rep(i,j) for(int i=0;i<j;++i)
#define loop(i,a,j) for(int i=a;i<j;++i)
#define mpi(it,table,T,E) for(map<T,E>::iterator it = table.begin();it!=table.end();++it)
#define PI 3.141592654
/*
ifstream fin("input.txt");
ofstream fout("output.txt");
#define cin fin
#define cout fout
*/

struct data{
	int i;
	double t;
};

bool order(data a,data b){
	return a.t < b.t;
}

int main(){
	data tmp;
	vector<data> g_1;
	vector<data> g_2;
	vector<data> g_3;

	rep(i,24){
		scanf("%d %lf",&tmp.i,&tmp.t);
		if( 1 <= tmp.i && tmp.i <=8){
			g_1.push_back(tmp);
		}else if( 9 <= tmp.i && tmp.i <=16){
			g_2.push_back(tmp);
		}else if( 17 <= tmp.i && tmp.i <= 24){
			g_3.push_back(tmp);
		}
	}
	stt(g_1,order);
	stt(g_2,order);
	stt(g_3,order);
	printf("%d %.2lf\n",g_1[0].i,g_1[0].t);
	printf("%d %.2lf\n",g_1[1].i,g_1[1].t);
	printf("%d %.2lf\n",g_2[0].i,g_2[0].t);
	printf("%d %.2lf\n",g_2[1].i,g_2[1].t);
	printf("%d %.2lf\n",g_3[0].i,g_3[0].t);
	printf("%d %.2lf\n",g_3[1].i,g_3[1].t);
	vector<data> g_e;
	g_e.push_back(g_1[2]);
	g_e.push_back(g_2[2]);
	g_e.push_back(g_3[2]);
	stt(g_e,order);
	printf("%d %.2lf\n",g_e[0].i,g_e[0].t);
	printf("%d %.2lf\n",g_e[1].i,g_e[1].t);
	return 0;
}