#define _USE_MATH_DEFINES
#include <iostream>
#include <complex>
#include <algorithm>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <cmath>
#include <math.h>
#include <numeric>
#include <list>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <climits>
#include <set>
#include <memory.h>
#include <memory>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cassert>
#include <map>
#include <cassert>
#include <time.h>

using namespace std;

typedef complex<double> xy_t;
typedef pair<xy_t, xy_t> line;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int , P> PP;
typedef pair<int, string> Ps;
typedef vector<int> vec;
typedef vector<vec> mat;
const int INF= 1 << 30;
const double EPS = 1e-9;
const double PI = 3.1415926535897932384626433832795;

#define rep(i, n) for(int i = 0; i < n; i++)

double cross(const xy_t &a, const xy_t &b){
	return imag(conj(a) * b);
}

double dot(const xy_t &a, const xy_t &b){
	return real(conj(a) * b);
}

xy_t projection(const line &l, const xy_t &p){
	double t = dot(p - l.first, l.first - l.second) / norm(l.first - l.second);
	return l.first + t * (l.first - l.second);
}

bool intersectSP(const line &l, const xy_t &p){
	return abs(l.first- p) + abs(l.second - p) - abs(l.first - l.second) < EPS;
}

double distanceSP(line s, xy_t p){
	const xy_t r = projection(s, p);
	if(intersectSP(s, r)) return abs(r - p);
	return min(abs(s.first - p), abs(s.second - p));
}


struct data{
	int id;
	int g;
	double d;
	data(){};
	data(int id, int g, double d){
		this-> id = id;
		this->g = g;
		this->d = d;
	}
};

bool comp(data d1, data d2){
	return d1.d < d2.d;
}

data ds[24];
bool used[24];

int main(){
	fill(used, used + 24,false);
	rep(i, 24){
		cin >> ds[i].id >> ds[i].d;
		ds[i].g = i / 8;
	}
	sort(ds, ds + 24, comp);
	int cnt = 0;
	rep(i, 24){
		if(cnt < 2 && !used[i] && ds[i].g == 0){
			cnt++;
			used[i] = true;
			cout << fixed << setprecision(2) <<  ds[i].id << " " << ds[i].d << endl;
		}
	}
	cnt = 0;
	rep(i, 24){
			if(cnt < 2 && !used[i] && ds[i].g == 1){
			cnt++;
			used[i] = true;
			cout << ds[i].id << " " << ds[i].d << endl;
		}
	}
	cnt = 0;
	rep(i, 24){
		if(cnt < 2 && !used[i] && ds[i].g == 2){
			cnt++;
			used[i] = true;
			cout << ds[i].id << " " << ds[i].d << endl;
		}
	}
	cnt = 0;
	rep(i, 24){
		if(cnt < 2 && !used[i]){
			cnt++;
			used[i] = true;
			cout << ds[i].id << " " << ds[i].d << endl;
		}
	}
	return 0;
}