#include <stdio.h>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) (EQ((a).real(),(b).real()) && EQ((a).imag(),(b).imag()))

typedef complex<double> P;
typedef long long ll;

const int MAX_SIZE = 10000;

int main(){

	pair<double,int> info;
	pair<double,int> data[3][8];
	for(int i = 0; i < 3; i++){
		for(int j = 0; j < 8; j++){
			cin>>data[i][j].second>>data[i][j].first;
		}
	}
	for(int i = 0; i < 3; i++)
		sort(data[i],data[i]+8);

	pair<double,int> lose[18];
	int idx=0;
	for(int i = 0; i < 3; i++){
		for(int j = 0; j < 8; j++){
			if(j<=1){
				cout<<data[i][j].second<<" "<<data[i][j].first<<endl;
			}
			else{
				lose[idx].first=data[i][j].first;
				lose[idx].second=data[i][j].second;
				idx++;
			}
		}
	}
	sort(lose,lose+18);
	for(int i = 0; i < 2; i++){
		cout<<lose[i].second<<" "<<lose[i].first<<endl;
	}
	

	return 0;
}