#include <iostream>
#include <cstdio>
using namespace std;
struct {int n; double t;} p[3][8], x, q[18];
int main()
{
	int i, j, k;
	for (i = 0; i < 3; i++)
	{
		for (j = 0; j < 8; j++)
			cin >> p[i][j].n >> p[i][j].t;
		for (j = 0; j < 8; j++)
			for (k = 0; k < 7; k++)
				if (p[i][k].t > p[i][k+1].t)
				{
					x = p[i][k];
					p[i][k] = p[i][k+1];
					p[i][k+1] = x;
				}
	}
	for (i = 0; i < 3; i++)
	{
		for (j = 0; j < 2; j++)
			printf("%d %.2f\n", p[i][j].n, p[i][j].t);
		for (j = 2; j < 8; j++)
			q[i*6+j-2] = p[i][j];
	}
	for (i = 0; i < 18; i++)
		for (j = 0; j < 17; j++)
			if (q[j].t > q[j+1].t)
			{
				x = q[j];
				q[j] = q[j+1];
				q[j+1] = x;
			}
	for (i = 0; i < 2; i++)
		printf("%d %.2f\n", q[i].n, q[i].t);
}