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

typedef pair<int, double> i_d;
#define rep(i, n)for((i) = 0;(i) < (n);++(i))

bool dsort(i_d qwe, i_d rty){
	return qwe.second < rty.second;
}
i_d pt[3][8], f[18];
int hd = 0;

int main(void){
	int i, j, n = 24;
	rep(i, n)scanf("%d %lf", &pt[i/8][i%8].first, &pt[i/8][i%8].second);
	rep(i, 3)sort(pt[i], pt[i] + 8, dsort);
	rep(i, 3)rep(j, 8){
		if(j < 2)printf("%d %.2lf\n", pt[i][j].first, pt[i][j].second);
		else f[hd++] = pt[i][j];
	}
	sort(f, f + hd, dsort);
	rep(i, 2)printf("%d %.2lf\n", f[i].first, f[i].second);

	return 0;
}