#include <cstdio>
#include <queue>
using namespace std;

typedef pair<double, int> PAIR;

int main(){
	int c;
	double v;
	priority_queue<PAIR> queu;
	for(int i = 0; i < 3; i++){
		priority_queue<PAIR> que;
		for(int j = 0; j < 8; j++){
			scanf("%d %lf", &c, &v);
			que.push(PAIR(-v, c));
		}
		c = que.top().second;
		v = que.top().first;
		printf("%d %lf\n", c, -v);
		que.pop();
		c = que.top().second;
		v = que.top().first;
		printf("%d %lf\n", c, -v);
		que.pop();
		for(int j = 0; j < 18; j++){
			queu.push(PAIR(que.top().first, que.top().second));
			que.pop();
		}
	}
	c = queu.top().second;
	v = queu.top().first;
	printf("%d %lf\n", c, -v);
	queu.pop();
	c = queu.top().second;
	v = queu.top().first;
	printf("%d %lf\n", c, -v);
	queu.pop();
	return 0;
}