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

int main(int argc, const char * argv[])
{
    struct data {
        int name;
        double time;
    };
    data kiroku[24];
    for (int i = 0; i < 24; i++) {
        cin >> kiroku[i].name >> kiroku[i].time;
    }
    for (int i = 0; i < 8; i++) {
        for (int j = 0; j < 7; j++) {
            if (kiroku[j].time > kiroku[j+1].time) {
                data tmp = kiroku[j];
                kiroku[j] = kiroku[j+1];
                kiroku[j+1] = tmp;
            }
        }
    }
    for (int i = 8; i < 16; i++) {
        for (int j = 8; j < 15; j++) {
            if (kiroku[j].time > kiroku[j+1].time) {
                data tmp = kiroku[j];
                kiroku[j] = kiroku[j+1];
                kiroku[j+1] = tmp;
            }
        }
    }
    for (int i = 16; i < 24; i++) {
        for (int j = 16; j < 23; j++) {
            if (kiroku[j].time > kiroku[j+1].time) {
                data tmp = kiroku[j];
                kiroku[j] = kiroku[j+1];
                kiroku[j+1] = tmp;
            }
        }
    }
    printf("%d %.2f\n", kiroku[0].name, kiroku[0].time);
    printf("%d %.2f\n", kiroku[1].name, kiroku[1].time);
    printf("%d %.2f\n", kiroku[8].name, kiroku[8].time);
    printf("%d %.2f\n", kiroku[9].name, kiroku[9].time);
    printf("%d %.2f\n", kiroku[16].name, kiroku[16].time);
    printf("%d %.2f\n", kiroku[17].name, kiroku[17].time);
    
    data tmp = {0, 0};
    kiroku[0] = kiroku[1] = kiroku[8] = kiroku[9] = kiroku[16] =kiroku[17] = tmp;
    
    for (int i = 0; i < 24; i++) {
        for (int j = 0; j < 23; j++) {
            if (kiroku[j].time > kiroku[j+1].time) {
                data tmp = kiroku[j];
                kiroku[j] = kiroku[j+1];
                kiroku[j+1] = tmp;
            }
        }
    }
    printf("%d %.2f\n", kiroku[6].name, kiroku[6].time);
    printf("%d %.2f\n", kiroku[7].name, kiroku[7].time);
    return 0;
}