#include <bits/stdc++.h>

struct player {
    int id;
    double t;
};

bool cmp(player const &lhs, player const &rhs) {
    return lhs.t < rhs.t;
}
void print(player const &p) {
    std::cout << p.id << " " << std::fixed << std::setprecision(2) << p.t << std::endl;
}

int main(void)
{
    std::vector<player> g[3];

    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 8; j++) {
            player p;
            std::cin >> p.id >> p.t;
            g[i].emplace_back(p);
        }
    }

    for (int i = 0; i < 3; i++) {
        std::sort(g[i].begin(), g[i].end(), cmp);
    }

    std::vector<player> rest;

    for (int i = 0; i < 3; i++) {
        print(g[i][0]);
        print(g[i][1]);
        std::copy(g[i].begin() + 2, g[i].end(), std::back_inserter(rest));
    }

    std::sort(rest.begin(), rest.end(), cmp);

    print(rest[0]);
    print(rest[1]);

    return 0;
}