#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 stt(it,order) sort(it.begin(),it.end(),order)
#define st(it) sort(it.begin(),it.end())
#define ll long long
#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;
}

vector<data> a;
vector<data> b;
vector<data> c;
vector<data> e;

int main(){
	data tmp;
	while(scanf("%d %lf",&tmp.i,&tmp.t) != EOF){
		a.clear();b.clear();c.clear();e.clear();
		a.push_back(tmp);
		rep(i,7){
			scanf("%d %lf",&tmp.i,&tmp.t);
			a.push_back(tmp);
		}
		rep(i,8){
			scanf("%d %lf",&tmp.i,&tmp.t);
			b.push_back(tmp);
		}
		rep(i,8){
			scanf("%d %lf",&tmp.i,&tmp.t);
			c.push_back(tmp);
		}
		stt(a,order);
		stt(b,order);
		stt(c,order);
		printf("%d %.2f\n",a[0].i,a[0].t);
		printf("%d %.2f\n",a[1].i,a[1].t);
		printf("%d %.2f\n",b[0].i,b[0].t);
		printf("%d %.2f\n",b[1].i,b[1].t);
		printf("%d %.2f\n",c[0].i,c[0].t);
		printf("%d %.2f\n",c[1].i,c[1].t);
		
		e.push_back(a[2]);
		e.push_back(b[2]);
		e.push_back(c[2]);
		stt(e,order);
		printf("%d %.2f\n",e[0].i,e[0].t);
		printf("%d %.2f\n",e[1].i,e[1].t);
		
	}
	return 0;
}