#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define MP make_pair
#define PB push_back

typedef pair<double, int> pdi;
typedef vector<pdi> vp;

int main() {
	vp v[4];
	
	REP(i, 3) {
		REP(j, 8) {
			int num;
			double t;
			scanf("%d %lf", &num, &t);
			v[i].PB(MP(t, num));
		}
		sort(v[i].begin(), v[i].end());
	}
	
	REP(i, 3) {
		REP(j, 2) {
			cout << v[i][j].second << " " << v[i][j].first << endl;
		}
		FOR(j, 2, 8)
			v[3].PB(v[i][j]);
	}
	
	sort(v[3].begin(), v[3].end());
	REP(i, 2) cout << v[3][i].second << " " << v[3][i].first << endl;
	
	return 0;
}