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

int main(){
	double t[1000] = {};
	vector<double> ans;
	vector<double> p;

	for(int i=0 ; i<3 ; ++i ){
		vector<double> vc;
		for(int j=0 ; j<8 ; ++j ){
			int No;
			double time;
			scanf("%d %lf", &No , &time );
			t[No] = time;
			vc.push_back(time);
			p.push_back(time);
		}
		sort( vc.begin() , vc.end() );
		ans.push_back( vc[0] );
		ans.push_back( vc[1] );
	}
	vector<double> foo;
	for(int i=0 ; i<p.size() ; ++i){
		bool flag = true;
		for(int j=0 ; j<(int)ans.size() ; ++j )
			if( p[i] == ans[j] )
				flag = false;
		
		if( flag )
			foo.push_back( p[i] );
	}
	sort( foo.begin() , foo.end() );
	ans.push_back( foo[0] );
	ans.push_back( foo[1] );
	
	for(int i=0 ; i<(int)ans.size() ; ++i ){
		for(int j=0 ; j<25 ; ++j ){
			if( t[j] == ans[i] )
				printf("%d %.2f\n", j , ans[i] );
		}
	}
}