#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, m, n) for(int i=(m); i<(n); ++i)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl
#define Cout2(x, y) cout << (x) << " " << (y) << endl
#define dump(x) cout << #x << " = " << (x) << endl;
#define forauto(i, a) for(auto i : a)cout << i << " "; puts("");
typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
const int inf = 1e9;
const double pi = acos(-1.0);

int main() {
	vector<vector<pair<double, int>>> a(3, vector<pair<double, int>>(8));
	rep(i, 24)cin >> a[i / 8][i % 8].second >> a[i / 8][i % 8].first;
	rep(i, 3)sort(all(a[i]));
	//rep(i, 6)Cout2(a[i / 2][i % 2].second, a[i / 2][i % 2].first);
	rep(i, 6) { cout << a[i / 2][i % 2].second; printf(" %.2f\n", a[i / 2][i % 2].first); }

	vector<pair<double, int>> b;
	rep(i, 18)b.pb(a[i / 6][i % 6 + 2]);
	sort(all(b));
	//rep(i, 2)Cout2(b[i].second, b[i].first);
	rep(i, 2) { cout << b[i].second; printf(" %.2f\n", b[i].first); }
}
