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

#define MAX_N 8000
#define MAX_M 23994

pair<double, int>a[MAX_N]; 
pair<double, int>b[MAX_N]; 
pair<double, int>c[MAX_N];
pair<double, int>d[MAX_M];

void _cin(int p) {
	for (int i = 0; i < p; i++) {
		cin >> a[i].second >> a[i].first;
	}
	for (int i = 0; i < p; i++) {
		cin >> b[i].second >> b[i].first;
	}
	for (int i = 0; i < p; i++) {
		cin >> c[i].second >> c[i].first;
	}
}

void sort1(int p) {
	sort(a, a + p);
	sort(b, b + p);
	sort(c, c + p);
	for (int i = 0; i < 6; i++) {
		d[i].first = a[i + 2].first;
		d[i].second = a[i + 2].second;
	}
	for (int i = 0; i < 6; i++) {
		d[i + p - 2].first = b[i + 2].first;
		d[i + p - 2].second = b[i + 2].second;
	}
	for (int i = 0; i < 6; i++) {
		d[i + p + p - 4].first = c[i + 2].first;
		d[i + p + p - 4].second = c[i + 2].second;
	}
	sort(d, d + p * 3 - 6);
}

void print() {
	cout << a[0].second << ' ' << a[0].first << endl;
	cout << a[1].second << ' ' << a[1].first << endl;
	cout << b[0].second << ' ' << b[0].first << endl;
	cout << b[1].second << ' ' << b[1].first << endl;
	cout << c[0].second << ' ' << c[0].first << endl;
	cout << c[1].second << ' ' << c[1].first << endl;
	cout << d[0].second << ' ' << d[0].first << endl;
	cout << d[1].second << ' ' << d[1].first << endl;
}

int main() {
	_cin(8);
	sort1(8);
	print();
	return 0;
}