#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
#include <iomanip>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
typedef pair<double,int> pdi;
int main(){
	vector<pdi> data[4];
	int k = 0;
	for(int i =0; i< 24;i++){
		int p;
		double t;
		cin>>p>>t;
		if(i<8){
			data[k].push_back(pdi(t,p));
		}else if(i>=8&&i <16){
			if(k==0){
				k++;
			}
			data[k].push_back(pdi(t,p));
		}else if(i>=16){
			if(k==1){
				k++;
			}
			data[k].push_back(pdi(t,p));
		}
	}
	for(int k = 0;k < 3;k++){
		sort(data[k].begin(),data[k].end());
	}
	cout <<fixed<<setprecision(2);
	for(int k =0;k <3;k++){
		for(int i =0;i <2;i++){
			cout <<data[k][i].second<<" "<<data[k][i].first<<endl;
		}
		data[3].push_back(pdi(data[k][2].first,data[k][2].second));
	}
	sort(data[3].begin(),data[3].end());
	for(int i =0;i <2;i++){
		cout <<data[3][i].second<<" "<<data[3][i].first<<endl;
	}
	return 0;
}