#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <deque>
#include <cstdio>
using namespace std;

bool cmp(pair<int,double> A ,pair<int,double> B){
	return A.second < B.second;
}
int main(){
	int t;
	double td;
	deque < pair<int,double> > a;
	vector< pair<int,double> > b;
	vector< pair<int,double> > ret;
	for(int i=0;i<8;i++){
		cin >> t >> td;
		a.push_back(make_pair(t,td));
	}
	sort(a.begin(),a.end(),cmp);
	ret.push_back(a[0]);a.pop_front();
	ret.push_back(a[0]);a.pop_front();
	for(int i=0;i<6;i++){
		b.push_back(a[i]);
	}
	a.clear();
	for(int i=0;i<8;i++){
		cin >> t >> td;
		a.push_back(make_pair(t,td));
	}
	sort(a.begin(),a.end(),cmp);
	ret.push_back(a[0]);a.pop_front();
	ret.push_back(a[0]);a.pop_front();
	for(int i=0;i<6;i++){
		b.push_back(a[i]);
	}
	a.clear();
	for(int i=0;i<8;i++){
		cin >> t >> td;
		a.push_back(make_pair(t,td));
	}
	sort(a.begin(),a.end(),cmp);
	ret.push_back(a[0]);a.pop_front();
	ret.push_back(a[0]);a.pop_front();
	for(int i=0;i<6;i++){
		b.push_back(a[i]);
	}
	sort(b.begin(),b.end(),cmp);
	for(int i=0;i<2;i++){
		ret.push_back(b[i]);
	}
	for(int i=0;i<ret.size();i++){
		printf("%d %.2lf\n",ret[i].first,ret[i].second);
	}
}