#include <iostream>
#include <limits.h>

using namespace std;


struct p_tag {
	int num;
	double time;
} P[3][8], tmp;

void sort()
{
	int i, j, k;
	for( i=0; i<3; i++ ){
		for( j=0; j<8; j++ ){
			for( k=j+1; k<8; k++ ){
				if( P[i][j].time > P[i][k].time ){
					tmp = P[i][j];
					P[i][j] = P[i][k];
					P[i][k] = tmp;
				}
			}
		}
	}

	return;
}


int main(void)
{
	int i, j, min;

	for( i=0; i<3; i++ )
		for( j=0; j<8; j++ )
			cin >> P[i][j].num >> P[i][j].time;

	sort();

	for( i=0; i<3; i++ )
		for( j=0; j<2; j++ )
			printf("%d %.2f\n", P[i][j].num, P[i][j].time );


	for( i=0; i<2; i++ ){
		min = 0;
		for( j=1; j<3; j++ )
			if( P[min][2].time > P[j][2].time )
				min = j;
		printf("%d %.2f\n", P[min][2].num, P[min][2].time );
		P[min][2].time = INT_MAX;
	}

	return 0;
}