#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int main()
{
	vector<pair<double,int> > v,v1,v2,temp;
	int a;
	double b;
	
	rep(i,8)
	{
		cin >> a >> b;
		v.push_back(make_pair(b,a));
	}

	rep(i,8)
	{
		cin >> a >> b;
		v1.push_back(make_pair(b,a));
	}

	rep(i,8)
	{
		cin >> a >> b;
		v2.push_back(make_pair(b,a));
	}

	sort(v.begin(),v.end());
	sort(v1.begin(),v1.end());
	sort(v2.begin(),v2.end());
	
	cout << fixed;
	cout.precision(2);

	REP(i,2,4)
	{
		temp.push_back(v[i]);
		temp.push_back(v1[i]);
		temp.push_back(v2[i]);
	}

	sort(temp.begin(),temp.end());

	rep(i,2) cout << v[i].second << " " << v[i].first << endl;
	rep(i,2) cout << v1[i].second << " " << v1[i].first << endl;
	rep(i,2) cout << v2[i].second << "  "<< v2[i].first << endl;
	rep(i,2) cout << temp[i].second << " " <<temp[i].first << endl;
	return 0;
}