#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstdio>
using namespace std;

int main() {
	vector<vector<pair<double,int> > > v;
	vector<pair<double,int> > v1;
	for(int i = 0; i < 3; i++) {
		v.push_back(vector<pair<double,int> >());
		for(int j = 0; j < 8; j++) {
			pair<double,int> tmp;
			cin >> tmp.second >> tmp.first;
			v[i].push_back(tmp);
		}
		sort(v[i].begin(), v[i].end());
		for(int j = 0; j < 2; j++) {
			printf("%d %.2f\n", v[i][j].second, v[i][j].first);
		}
		v1.insert(v1.end(), v[i].begin() + 2, v[i].end());
	}

	sort(v1.begin(), v1.end());
	for(int j = 0; j < 2; j++) {
		printf("%d %.2f\n", v1[j].second, v1[j].first);
	}

}