#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>

using namespace std;

typedef long long ll;

int main(){
	vector<vector<pair<double, int> >> v(3, vector<pair<double, int> >(8));
	vector<pair<double, int> > u;
	for (int i = 0; i < 3; i++){
		for (int j = 0; j < 8; j++){
			cin >> v[i][j].second >> v[i][j].first;
		}
		sort(v[i].begin(), v[i].end());
		cout << v[i][0].second << " " << v[i][0].first << endl;
		cout << v[i][1].second << " " << v[i][1].first << endl;
		for (int j = 2; j < 8; j++){
			u.push_back(v[i][j]);
		}
	}
	sort(u.begin(), u.end());
	cout << u[0].second << " " << u[0].first << endl;
	cout << u[1].second << " " << u[1].first << endl;
}