#include <stdio.h>
#include <algorithm>
using namespace std;
pair<double, int> p1[8], p2[8], p3[8], p4[24];
int main() {
	for(int i = 0; i < 8; i++) scanf("%d %lf", &p1[i].second, &p1[i].first), p4[i] = p1[i]; sort(p1, p1 + 8);
	for(int i = 0; i < 8; i++) scanf("%d %lf", &p2[i].second, &p2[i].first), p4[i + 8] = p1[i]; sort(p2, p2 + 8);
	for(int i = 0; i < 8; i++) scanf("%d %lf", &p3[i].second, &p3[i].first), p4[i + 16] = p1[i]; sort(p3, p3 + 8);
	printf("%d %lf\n%d %lf\n", p1[0].second, p1[0].first, p1[1].second, p1[1].first);
	printf("%d %lf\n%d %lf\n", p2[0].second, p2[0].first, p2[1].second, p2[1].first);
	printf("%d %lf\n%d %lf\n", p3[0].second, p3[0].first, p3[1].second, p3[1].first);
	sort(p4, p4 + 24);
	for(int i = 0, c = 0; c < 2; i++) {
		int s = p4[i].second; bool flag = true;
		flag = flag && (s != p1[0].second && s != p2[0].second && s != p3[0].second);
		flag = flag && (s != p1[1].second && s != p2[1].second && s != p3[1].second);
		if(flag) printf("%d %lf\n", p4[i].second, p4[i].first), c++;
	}
	return 0;
}