#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()
{
	map<int,double> m;

	rep(i,24)
	{
		int a;
		double b;
		cin >> a >> b;

		m[a] = b;
	}
	
	vector<pair<double,int> > v;
	vector<pair<double,int> > temp;
	REP(i,1,8)
	{
		v.push_back(make_pair(m[i],i));	
	}
	sort(v.begin(),v.end());
	
	cout << fixed;
	cout.precision(2);
	cout << v[0].second << " " << v[0].first << endl;
	cout << v[1].second << " " << v[1].first << endl;
	temp.push_back(v[2]);
	temp.push_back(v[3]);

	v.clear();
	REP(i,8,17)
	{
		v.push_back(make_pair(m[i],i));
	}
	sort(v.begin(),v.end());

	cout << v[0].second << " " << v[0].first << endl;
	cout << v[1].second << " " << v[1].first << endl;	
	temp.push_back(v[2]);
	temp.push_back(v[3]);
	v.clear();
	
	REP(i,17,25)
	{
		v.push_back(make_pair(m[i],i));
	}

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

	cout << v[0].second << " " << v[0].first << endl;
	cout << v[1].second << " " << v[1].first << endl;	
	temp.push_back(v[2]);
	temp.push_back(v[3]);

	sort(temp.begin(),temp.end());
	cout << temp[0].second << " " << temp[0].first << endl;
	cout << temp[1].second << " " << temp[1].first << endl;

	return 0;
}