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


typedef struct{
    int backnum;
    double time;
} runner;

void q_sort(runner data[], int begin, int end);

int main(int argc, const char * argv[])
{
    int a = 0;
    runner data[3][8];
    runner under[6];
    for (int i = 0; i < 3; i++) {
        for (int k = 0; k < 8; k++) {
            cin >> data[i][k].backnum >> data[i][k].time;
        }
    }
    for (int i = 0; i < 3; i++) {
        q_sort(data[i], 0, 7);
    }
    for (int i = 0; i < 3; i++){
        for (int k = 2; k < 4; k++) {
            under[a] = data[i][k];
            a++;
        }
    }
    q_sort(under, 0, 5);
    for (int i = 0; i < 3; i++) {
        for (int k = 0; k < 2; k++) {
            printf("%d %.2f\n", data[i][k].backnum, data[i][k].time);
        }
    }
    for (int i = 0; i < 2; i++) {
        printf("%d %.2f\n", under[i].backnum, under[i].time);
    }
    return 0;
}

void q_sort(runner data[], int begin, int end){
    int i = begin;
    int k = end;
    runner pivot;
    runner temp;
    pivot = data[(begin + end) / 2];
    while (1) {
        while (data[i].time < pivot.time) {
            i++;
        }
        while (pivot.time < data[k].time) {
            k--;
        }
        if (i >= k) {
            break;
        }
        temp = data[i];
        data[i] = data[k];
        data[k] = temp;
        i++;
        k--;
    }
    if (begin < i - 1) {
        q_sort(data, begin, i - 1);
    }
    if (k + 1 < end) {
        q_sort(data, k + 1, end);
    }
}