#include<iostream>
#include<cstdio>
#include<queue>
#include<map>
#include<functional>
#include<vector>
#define rep(i,k) for(int i=0;i<k;i++)
using namespace std;
typedef pair<double,int> P;
int main(){
	int x;
	double y;
	priority_queue<P,vector<P>,greater<P> > a[3];
	priority_queue<P,vector<P>,greater<P> > b;
	rep(i,3){
		rep(j,8){
			cin>>x>>y;
			a[i].push(P(y,x));
		}
		rep(k,2){
			P q=a[i].top();
			printf("%d %.2lf\n",q.second,q.first);
			a[i].pop();
		}
		rep(k,6){
			b.push(a[i].top());
			a[i].pop();
		}
	}
	rep(k,2){
		P p=b.top();
		printf("%d %.2lf\n",p.second,p.first);
		b.pop();
	}
	return 0;
}