#include <iostream>
#include <cstdio>
#include <map>
#include <utility>
using namespace std;
#define rep2(x,from,to) for(int x=(from);x<(to);++(x))
#define rep(x,to) rep2(x,0,to)

int main() {
	map<double, int> m;
	map<double, int> ma;
	int n;
	double t;
	rep(i,3) {
		rep(j,8) {
			cin >> n >> t;
			m.insert(make_pair(t,n));
		}
		auto it = m.begin();
		rep(j,2) {
			cout << (*it).second << " ";
			printf("%.2lf\n", (*it).first);
			++it;
		}
		ma.insert(*it);
		m.clear();
	}
	auto it2 = ma.begin();
	rep(i,2) {
		cout << (*it2).second << " ";
		printf("%.2lf\n", (*it2).first);
		++it2;
	}
	return 0;
}