#include <cstdio>
#include <map>
#include <algorithm>
using namespace std;
pair<double, int> a[3][8], b[18], res[8];
int main()
{
    for (int i = 0; i < 24; ++i) {
        int t;
        double f;
        scanf("%d%lf", &t, &f);
        a[i / 8][i % 8] = make_pair(f, t);
    }
    int k = 0, l = 0;
    for (int i = 0; i < 3; ++i) {
        sort(a[i], a[i]+8);
        res[k++] = a[i][0];
        res[k++] = a[i][1];
        for (int j = 2; j < 8; ++j) b[l++] = a[i][j];
    }
    sort(b, b+18);
    res[k++] = b[0];
    res[k++] = b[1];
    for (int i = 0; i < 8; ++i)
        printf("%d %.2f\n", res[i].second, res[i].first);
    return 0;
}