/*
	Track and field Competition
*/
#include	<iostream>
#include	<cstdio>
#include	<vector>
#include	<utility>
#include	<algorithm>
#include	<functional>

using namespace std;

typedef pair<double, int> P_DI;

int main(void) {
	vector<P_DI> Group1, Group2, Group3, GroupMod;
	int buff_sc, c;
	double buff_tm;
	
	for(int i = 0; i < 8; i++) {
		cin >> buff_sc >> buff_tm;
		Group1.push_back( P_DI(buff_tm, buff_sc) );
	}
	for(int i = 0; i < 8; i++) {
		cin >> buff_sc >> buff_tm;
		Group2.push_back( P_DI(buff_tm, buff_sc) );
	}
	for(int i = 0; i < 8; i++) {
		cin >> buff_sc >> buff_tm;
		Group3.push_back( P_DI(buff_tm, buff_sc) );
	}
	sort(Group1.begin(), Group1.end());
	sort(Group2.begin(), Group2.end());
	sort(Group3.begin(), Group3.end());
	
	c = 1;
	vector<P_DI>::iterator it = Group1.begin();
	while(it != Group1.end()) {
		if(c < 3) {
			printf("%d %5.2f\n", (*it).second, (*it).first);
		} else {
			GroupMod.push_back( P_DI((*it).first, (*it).second) );
		}
		c++;
		it++;
	}
	c = 1;
	it = Group2.begin();
	while(it != Group2.end()) {
		if(c < 3) {
			printf("%d %5.2f\n", (*it).second, (*it).first);
		} else {
			GroupMod.push_back( P_DI((*it).first, (*it).second) );
		}
		c++;
		it++;
	}
	c = 1;
	it = Group3.begin();
	while(it != Group3.end()) {
		if(c < 3) {
			printf("%d %5.2f\n", (*it).second, (*it).first);
		} else {
			GroupMod.push_back( P_DI((*it).first, (*it).second) );
		}
		c++;
		it++;
	}
	
	sort(GroupMod.begin(), GroupMod.end());
	it = GroupMod.begin();
	for(int i = 0; i < 2; i++) {
		printf("%d %5.2f\n", (*it).second, (*it).first);
		it++;
	}
}