#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>
#include <complex>


typedef long long ll;
const double Eps = 1e-6;

using namespace std;

int main()
{
	pair<double ,int> runners[24];
	for (int i = 0; i < 24; ++i)
	{
		int a;
		double b;
		scanf("%d %lf", &a ,&b);
		runners[i] = make_pair(b, a);
	}
	for (int i = 0; i < 3; ++i)
	{
		sort(runners+i*8, runners+8+i*8);
		printf("%d %.2f\n", runners[0 + i*8].second, runners[0 + i*8]);
		printf("%d %.2f\n", runners[1 + i*8].second, runners[1 + i*8]);
		runners[0 + i*8].first = runners[1 + i*8].first = 1e10;
	}
	sort(runners, runners+24);
	printf("%d %.2f\n", runners[0].second, runners[0].first);
	printf("%d %.2f\n", runners[1].second, runners[1].first);

	return 0;
}