#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
//	cut here before submit 
//	freopen ("testcase.track", "r", stdin );
	string str = "";
	int n = 24;
	int i,j;

	map<double, pair<int, int> > race; // time, number of person, number of race

	for (i = 0; i < n; ++i){
		int number = 0;
		double time = 0.0;

		getline (cin, str );
		stringstream ss (str );

		ss >> number >> time;

		race.insert (make_pair (time, make_pair (number, i / 8) ) );
	} // end for
	
	vector<map<double, int> > res;

	for (i = 0; i < 4; ++i){
		j = 0;
		map<double, pair<int, int> >::iterator it = race.begin();
		for (; it != race.end(); ++it ){
			double time = (*it).first;
			double num  = (*it).second.first;
			double ra   = (*it).second.second;
			if (( i == 3 || ra == i ) && j < 2){
				map<double, int> r;
				r.insert (make_pair (time, num ) );
				res.push_back (r);
				++j;
				race.erase (it);
			} // end if
		} // end for
	} // end for

	for (i = 0; i < 8; ++i){
		map<double, int>::iterator itres = res[i].begin();
		for (; itres != res[i].end(); ++itres){
			double time = (*itres).first;
			int num = (*itres).second;
			printf ("%d %.2f\n", num, time );
		} // end for
	} // end for

	return 0;
}