#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
typedef pair<double, int> P;

void solve()
{
	vector<P> second;
	vector<P> a(8);
	vector<P> b(8);
	vector<P> c(8);
	for(int i = 0; i < 8; ++i)
	{
		cin >> a[i].second >> a[i].first;
	}
	for(int i = 0; i < 8; ++i)
	{
		cin >> b[i].second >> b[i].first;
	}
	for(int i = 0; i < 8; ++i)
	{
		cin >> c[i].second >> c[i].first;
	}
	sort(a.begin(), a.end());
	sort(b.begin(), b.end());
	sort(c.begin(), c.end());
	second.push_back(a[2]);
	second.push_back(a[3]);
	second.push_back(b[2]);
	second.push_back(b[3]);
	second.push_back(c[2]);
	second.push_back(c[3]);
	sort(second.begin(), second.end());
	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 << second[0].second << " " << second[0].first << endl;
	cout << second[1].second << " " << second[1].first << endl;
}

int main()
{
	solve();
	return(0);
}