#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>

using namespace std;

typedef struct _player{
	int num;
	double time;
}player;

bool lesstime(const player&l,const player&r){return l.time<r.time;}

vector<player> nokori;

void pr(player&p){
	printf("%d %.2f\n",p.num,p.time);
}

int main(){
	for(int i=0;i<3;i++){
		vector<player> rane;
		for(int j=0;j<8;j++){
			int n;
			double t;
			cin>>n>>t;
			player tp={n,t};
			rane.push_back(tp);
		}
		sort(rane.begin(),rane.end(),lesstime);
		pr(rane[0]);
		pr(rane[1]);
		for(int j=2;j<8;j++){
			nokori.push_back(rane[j]);
		}
	}
	
	sort(nokori.begin(),nokori.end(),lesstime);
	pr(nokori[0]);
	pr(nokori[1]);
}