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

int main(void){
	vector<pair<double,int> > v[3],vall;
	double time;
	int num;
	
	for(int i=0;i<24;i++){
		cin >> num >> time;
		if(i < 8){
			v[0].push_back(make_pair(time,num));
		}else if(i < 16){
			v[1].push_back(make_pair(time,num));
		}else{
			v[2].push_back(make_pair(time,num));
		}
	}
	sort(v[0].begin(),v[0].end());
	sort(v[1].begin(),v[1].end());
	sort(v[2].begin(),v[2].end());
	
	cout << v[0][0].second << " " << v[0][0].first << endl;
	cout << v[0][1].second << " " << v[0][1].first << endl;
	cout << v[1][0].second << " " << v[1][0].first << endl;
	cout << v[1][1].second << " " << v[1][1].first << endl;
	cout << v[2][0].second << " " << v[2][0].first << endl;
	cout << v[2][1].second << " " << v[2][1].first << endl;
	
	for(int i=2;i<8;i++){
		vall.push_back(v[0][i]);
		vall.push_back(v[1][i]);
		vall.push_back(v[2][i]);
	}
	
	sort(vall.begin(), vall.end());
	
	cout << vall[0].second << " " << vall[0].first << endl;
	cout << vall[1].second << " " << vall[1].first << endl;
}