#include<iostream>
#include<cstdio>
using namespace std;


//選手のタイムを返す構造体
typedef struct struct_sensyu
{
	int number;
	double time;
}S_sensyu;



int main(void)
{
	//構造体の宣言
	S_sensyu s_sensyu[3][8];

	//tmp実体
	S_sensyu s_tmp , s_tmp2;

	//構造体ポインタ
	S_sensyu *ptr_sensyu = &s_tmp;
	S_sensyu *ptr_sensyu2 = &s_tmp2;

	//考えるのが面倒なので18個構造体を宣言
	S_sensyu s_output2[6];

	//入力
	for (int i = 0; i < 3; i++)
	{
		for (int j = 0; j < 8; j++)
		{
			cin >> s_sensyu[i][j].number >> s_sensyu[i][j].time;
		}
	}

	//ソート
	for (int i = 0; i < 3; i++)
	{
		for (int j = 0; j < 7; j++)
		{
			for (int k = j + 1; k < 8; k++)
			{
				//タイムが早い順に入れ替える
				if (s_sensyu[i][j].time > s_sensyu[i][k].time)
				{
					*ptr_sensyu = s_sensyu[i][j];
					*ptr_sensyu2 = s_sensyu[i][k];
					s_sensyu[i][j] = *ptr_sensyu2;
					s_sensyu[i][k] = *ptr_sensyu;
				}
			}
		}
	}

	//まず最初に出力
	for (int i = 0; i < 3; i++)
	{
		for (int j = 0; j < 2; j++)
		{
			printf("%d %.2lf\n" , s_sensyu[i][j].number , s_sensyu[i][j].time);
		}
	}

	//カウント変数
	int count = 0;
	for (int i = 0; i < 3; i++)
	{
		for (int j = 2; j <= 3; j++)
		{
			//ポインタを利用して高速化
			*ptr_sensyu = s_sensyu[i][j];
			s_output2[count++] = *ptr_sensyu;
		}
	}

	//再びソート
	for (int i = 0; i < 5; i++)
	{
		for (int j = i + 1; j < 6; j++)
		{
			//タイムが早い順
			if (s_output2[i].time > s_output2[j].time)
			{
				*ptr_sensyu = s_output2[i];
				*ptr_sensyu2 = s_output2[j];
				s_output2[i] = *ptr_sensyu2;
				s_output2[j] = *ptr_sensyu;
			}
		}
	}

	//再び出力
	for (int i = 0; i < 2; i++)
	{
		printf("%d %.2lf\n" , s_output2[i].number , s_output2[i].time);
	}

	return 0;
}