#pragma warning(disable:4996)

#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <cstdio>

#define loop(i,a,b) for(int i=(a); i<int(b); i++)
#define rep(i,b) loop(i,0,b)
#define all(c) (c).begin(), (c).end()

using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;

int main(){
    vector<pii> v(24);
    rep(i, 24){
        int a, b, c;
        scanf("%d %d.%d",&a,&b,&c);
        v[i] = make_pair(b * 100 + c, a);
    }

    rep(i, 3){
        sort(v.begin() + 8 * i, v.begin() + 8 * i + 8);
    }
    vector<pii> ans;
    rep(i, 3)rep(j, 6){
        ans.push_back(v[i * 8 + j + 2]);
    }
    sort(all(ans));

    rep(i, 3) rep(j, 2){
        double t = 1.*ans[i].first / 100;
        printf("%d %.2f\n", v[i * 8 + j].second, t);
    }
    rep(i, 2){
        double t = 1.*ans[i].first / 100;
        printf("%d %.2f\n", ans[i].second, t);
    }
}