#include <stdio.h>
#include <iostream>

using namespace std;

void hantei (double k[], double t, int kk[], int tt) {
	if (k[1] > t) {
		k[1] = t;
		kk[1] = tt;
	}
	if (k[0] > k[1]) {
		k[1] = k[0];
		kk[1] = kk[0];
		k[0] = t;
		kk[0] = tt;
	}
}

int main() {
	double a[4] = {100.0, 100.0, 100.0, 100.0};
	double b[4] = {100.0, 100.0, 100.0, 100.0};
	double c[4] = {100.0, 100.0, 100.0, 100.0};
	double k[2] = {100.0, 100.0};
	int aa[4];
	int bb[4];
	int cc[4];
	int kk[2];
	double d;
	int dd;
	for (int i = 0; i < 8; i++) {
		cin >> dd >> d;
		if (a[3] > d) {
			a[3] = d;
			aa[3] = dd;
		} 
		for (int j = 2; j >= 0; j--) {
			if (a[j] > a[j+1]) {
				a[j+1] = a[j];
				aa[j+1] = aa[j];
				a[j] = d;
				aa[j] = dd;
			}
		}
	}
	for (int i = 0; i < 8; i++) {
		cin >> dd >> d;
		if (b[3] > d) {
			b[3] = d;
			bb[3] = dd;
		}
		for (int j = 2; j >= 0; j--) {
			if (b[j] > b[j+1]) {
				b[j+1] = b[j];
				bb[j+1] = bb[j];
				b[j] = d;
				bb[j] = dd;
			}
		}
	}
	for (int i = 0; i < 8; i++) {
		cin >> dd >> d;
		if (c[3] > d) {
			c[3] = d;
			cc[3] = dd;
		}
		for (int j = 2; j >= 0; j--) {
			if (c[j] > c[j+1]) {
				c[j+1] = c[j];
				cc[j+1] = cc[j];
				c[j] = d;
				cc[j] = dd;
			}
		}
	}

	hantei(k,a[2],kk,aa[2]);
	hantei(k,a[3],kk,aa[3]);
	hantei(k,b[2],kk,bb[2]);
	hantei(k,b[3],kk,bb[3]);
	hantei(k,c[2],kk,cc[2]);
	hantei(k,c[3],kk,cc[3]);
	
	printf("%d %.2f\n%d %.2f\n%d %.2f\n%d %.2f\n%d %.2f\n%d %.2f\n%d %.2f\n%d %.2f\n", aa[0], a[0], aa[1], a[1], bb[0], b[0], bb[1], b[1], cc[0], c[0], cc[1], c[1], kk[0], k[0], kk[1], k[1]);
	return 0;
}