#include <iostream>
#include <cstdio>
#include <map>
using namespace std;

int main() {
    map<double, int> players[3];
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 8; j++) {
            int num;
            double time;
            cin >> num >> time;
            players[i].insert(make_pair(time, num));
        }
    }
    map<double, int> notWinPlayers;
    for (int i = 0; i < 3; i++) {
        map<double, int>::iterator it = players[i].begin();
        printf("%d %.2f\n", it->second, it->first);
        it++;
        printf("%d %.2f\n", it->second, it->first);
        it++;
        for ( ; it != players[i].end(); it++) {
            notWinPlayers.insert(make_pair(it->first, it->second));
        }
    }
    int count = 0;
    for (map<double, int>::iterator it = notWinPlayers.begin(); count < 2; it++, count++) {
        printf("%d %.2f\n", it->second, it->first);
    }
}