#include <iostream>
#include <cstdio>
#include <string>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <iomanip>
#include <vector>
#include <queue>



using namespace std;

typedef pair<double, int> P;

int main()
{
	int num;
	double time;
	
	vector<P> remain;
	for (int i=0; i<3; i++)
	{
		vector<P> men;
		
		for (int j=0; j<8; j++)
		{
			cin >> num >> time;
			men.push_back(P(time, num));
		}
		
		sort(men.begin(), men.end());
		
		printf("%d %.2lf\n", men[0].second, men[0].first);
		printf("%d %.2lf\n", men[1].second, men[1].first);
		for (int j=2; j<men.size(); j++) remain.push_back(men[j]);
		
		/*
		for (int j=0; j<men.size(); j++)
		{
			cout << men[j].first << " : " << men[j].second << endl;
		}
		*/
	}
	
	sort(remain.begin(), remain.end());
	printf("%d %.2lf\n", remain[0].second, remain[0].first);
	printf("%d %.2lf\n", remain[1].second, remain[1].first);
	
	
	return 0;
}