#include<iostream>
#include<cstdio>
#include<utility>
#include<algorithm>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;
typedef pair<double,int> p;

int main(){
	p ath[3][8];
	rep(i,3)rep(j,8)cin>>ath[i][j].second>>ath[i][j].first;
	rep(i,3)sort(ath[i],ath[i]+8);
	rep(i,3)rep(j,2)printf("%d %.2f\n",ath[i][j].second,ath[i][j].first);
	p hoge[18];
	int cnt=0;
	rep(i,3)loop(j,2,8){hoge[cnt]=ath[i][j];cnt++;}
	sort(hoge,hoge+18);
	rep(i,2)printf("%d %.2f\n",hoge[i].second,hoge[i].first);
	return 0;
}