#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

typedef pair<double, int> pdi;

int main(){

	pdi v[3][8];
	
	for(int i=0; i<24; ++i){
		
		double a;
		int b;
		
		scanf("%d %lf", &b, &a);
		v[i/8][i%8] = make_pair(a, b);
	}
	
	for(int i=0; i<3; ++i){
		sort(v[i], v[i]+8);
	}
	
	vector<pdi> rest;
	
	for(int i=0; i<24; ++i){
	
		if(i%8<2)
			printf("%d %.2f\n", v[i/8][i%8].second, v[i/8][i%8].first);
		else
			rest.push_back(v[i/8][i%8]);
	}
	
	sort(rest.begin(), rest.end());
	
	for(int i=0; i<2; ++i){
		printf("%d %.2f\n", rest[i].second, rest[i].first);
	}
	
	return 0;
}