#include<bits/stdc++.h>
using namespace std;
#define rep(i,a) for(int i = 0; i < (a); i++)
#define reps(i, a, b) for(int i = (a); i < (b); i++)
#define INF 1e9
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef pair<double, int> pdi;
void output(pdi d) {
	printf("%d %.2lf\n", d.second, d.first);
}
int main() {
	vector<vector<pdi>> input = vector<vector<pdi>>(3, vector<pdi>(8, make_pair(0,0)));
	vector<pdi> h;
	rep(i, 3) {
		rep(j, 8) cin >> input[i][j].second >> input[i][j].first;
		sort(input[i].begin(), input[i].end(), greater<pdi>());
		rep(j, 2) {
			output(input[i].back());
			input[i].pop_back();
		}
		rep(j, input[i].size()) h.push_back(input[i][j]);
	}
	sort(h.begin(), h.end(), greater<pdi>());
	rep(i, 2) {
		output(h.back());
		h.pop_back();
	}
	
	return 0;
}