#include<bits/stdc++.h>
using namespace std;
typedef pair<double,int> P;

int main(){
	vector<P>a,b,c;
	for(int i=0;i<8;i++){
		int num;
		double t;
		cin>>num>>t;
		a.push_back(P(t,num));
		}
	for(int i=0;i<8;i++){
		int num;
		double t;
		cin>>num>>t;
		b.push_back(P(t,num));
		}	
	for(int i=0;i<8;i++){
		int num;
		double t;
		cin>>num>>t;
		c.push_back(P(t,num));
		}	
	sort(a.begin(),a.end());
	reverse(a.begin(),a.end());
	sort(b.begin(),b.end());
	reverse(b.begin(),b.end());
	sort(c.begin(),c.end());
	reverse(c.begin(),c.end());
	cout<<a[7].second<<' '<<a[7].first<<endl;
	cout<<a[6].second<<' '<<a[6].first<<endl;
	cout<<b[7].second<<' '<<b[7].first<<endl;
	cout<<b[6].second<<' '<<b[6].first<<endl;
	cout<<c[7].second<<' '<<c[7].first<<endl;
	cout<<c[6].second<<' '<<c[6].first<<endl;
	for(int i=0;i<2;i++)a.pop_back();
	for(int i=0;i<2;i++)b.pop_back();
	for(int i=0;i<2;i++)c.pop_back();
	
	for(int i=0;i<6;i++)a.push_back(b[i]);
	for(int i=0;i<6;i++)a.push_back(c[i]);
	sort(a.begin(),a.end());
	reverse(a.begin(),a.end());
	cout<<a[17].second<<' '<<a[17].first<<endl;
	cout<<a[16].second<<' '<<a[16].first<<endl;
	
	return 0;
		
	}