#include <bits/stdc++.h>

#define rep_(v, f, l) for (int v = (f); v < (l); ++v)
#define rep(v, n) rep_(v, 0, n)
#define lep(v, n) rep_(v, 1, n + 1)

using namespace std;

typedef long long int lint;
typedef pair<double, int> pdi;

static inline int in(){ int x; scanf("%d", &x); return x; }
static inline lint inl(){ lint x; scanf("%lld", &x); return x; }

int main()
{
    vector<pdi> a, b, c, total;
    rep(i, 24){
        double record;
        int id;
        scanf("%d %lf", &id, &record);
        if (i < 8){
            a.push_back(make_pair(record, id));
        }
        else if (i < 16){
            b.push_back(make_pair(record, id));
        }
        else {
            c.push_back(make_pair(record, id));
        }
    }
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    sort(c.begin(), c.end());
    rep(j, 3){
        rep(i, 2){
            if (j == 0){
                printf("%d %.2f\n", a[i].second, a[i].first);
            }
            if (j == 1){
                printf("%d %.2f\n", b[i].second, b[i].first);
            }
            if (j == 2){
                printf("%d %.2f\n", c[i].second, c[i].first);
            }
        }
    }
    rep(i, 6){
        total.push_back(a[i + 2]);
        total.push_back(b[i + 2]);
        total.push_back(c[i + 2]);
    }
    sort(total.begin(), total.end());
    rep(i, 2){
        printf("%d %.2f\n", total[i].second, total[i].first);
    }

    return (0);
}