#include<iostream>
#include<vector>
#include<queue>
#include<algorithm>
#include<functional>
using namespace std;
typedef pair<double,int> P;

int main(void){
	priority_queue<P, vector<P>, greater<P> > atime;
	queue<P> ktime;
	for(int i=0;i<3;i++){
		priority_queue<P, vector<P>, greater<P> > time;
		for(int j=0;j<8;j++){
			int a;
			double b;
			scanf("%d%lf",&a,&b);
			time.push(P(b,a));
		}
		for(int j=0;j<2;j++){
			P p=time.top();time.pop();
			ktime.push(P(p.first,p.second));
		}
		for(int j=0;j<2;j++){
			P p=time.top();time.pop();
			atime.push(P(p.first,p.second));
		}
	}
	for(int j=0;j<6;j++){
		P p=ktime.front();ktime.pop();
		printf("%d %0.2f\n",p.second,p.first);
	}
	for(int j=0;j<2;j++){
		P p=atime.top();atime.pop();
		printf("%d %0.2f\n",p.second,p.first);
	}
    return 0;
}