// #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>	// istringstream
using namespace std;

void Output(vector<pair<int, double> > ans){
	for (int i = 0; i < ans.size(); i++){
		printf("%d %.2lf\n", ans[i].first, ans[i].second);
	}
}

int main(){
	int number = 0, count = 0;
	double time = 0.0;
	map<double, int>	time_number;
	vector<pair<int, double> > ans;
	map<double, int>	plus2;

	while (cin >> number >> time){
		count++;
		time_number.insert(pair<double, int>(time, number));

		if (count == 8){
			map<double, int>::iterator it = time_number.begin();
			// 上位2人をansに格納
			for (int i = 0; i < 2; i++){
				ans.push_back(make_pair((*it).second, (*it).first));
				it = time_number.erase(it);
			}
			// それ以外はplus2に格納
			for (map<double, int>::iterator it = time_number.begin(); it != time_number.end(); it++){
				double first = (*it).first;
				int second = (*it).second;
				plus2.insert(pair<double, int>(first, second));
			}
			count = 0;
			time_number.clear();
		}
	}
	// ここまでで6人決まった

	// plus2の上位2人をansに格納
	map<double, int>::iterator it = plus2.begin();
	for (int i = 0; i < 2; i++){
		ans.push_back(make_pair((*it).second, (*it).first));
		it = plus2.erase(it);
	}

	Output(ans);
	return 0;
}