#include <cstdio>
#include <queue>
#include <algorithm>
using namespace std;

class player {
public:
    int id;
    double time;
    player(int _id, double _time) { id = _id; time = _time; }
};

int main()
{
    int id; double time;
    auto comp = [](const player &a, const player &b) {
        return a.time > b.time;
    };
    priority_queue<player, vector<player>, decltype (comp)> pq1(comp), pq2(comp), pq3(comp), b3(comp);
    for (int i = 0; i < 8; i++) { scanf("%d %lf", &id, &time); pq1.push(player(id, time)); }
    for (int i = 0; i < 8; i++) { scanf("%d %lf", &id, &time); pq2.push(player(id, time)); }
    for (int i = 0; i < 8; i++) { scanf("%d %lf", &id, &time); pq3.push(player(id, time)); }
    for (int i = 0; i < 2; i++) { printf("%d %.2lf\n", pq1.top().id, pq1.top().time); pq1.pop(); }
    b3.push(pq1.top());
    for (int i = 0; i < 2; i++) { printf("%d %.2lf\n", pq2.top().id, pq2.top().time); pq2.pop(); }
    b3.push(pq2.top());
    for (int i = 0; i < 2; i++) { printf("%d %.2lf\n", pq3.top().id, pq3.top().time); pq3.pop(); }
    b3.push(pq3.top());
    for (int i = 0; i < 2; i++) { printf("%d %.2lf\n", b3.top().id, b3.top().time); b3.pop(); }
    return 0;
}

