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

bool great( const pair<int,double>& left, const pair<int,double>& right ) {
    return left.second < right.second;
}

int main(){
	int n;
	double t;
	vector<pair<int,double> > v1,v2;
	for(int j = 0;j < 3;j++){
		for(int i = 0;i < 8;i++){
			cin >> n >> t;
			v1.push_back(make_pair(n,t));
		}
		sort(v1.begin(),v1.end(),great);
		printf("%d %.2f\n%d %.2f\n",v1[0].first,v1[0].second,v1[1].first,v1[1].second);
		for(int k = 2;k < 8;k++) v2.push_back(v1[k]);
		v1.clear();
	}
	sort(v2.begin(),v2.end(),great);
	printf("%d %.2f\n%d %.2f\n",v2[0].first,v2[0].second,v2[1].first,v2[1].second);
	return 0;
}