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

typedef pair <double, int> PDI;

void print( PDI p )
{
    printf( "%d %.2f\n", p.second, p.first );
}

int main() {
    vector <PDI> big_list(18);
    int bl_index=0;
    for ( int i = 0; i < 3; i++ ) {
        vector <PDI> list( 8 );
        for ( int j = 0; j < 8; j++ ) {
            cin >> list[j].second >> list[j].first;
        }

        sort( list.begin(), list.end() );
        print( list[0] );
        print( list[1] );

        for ( int j = 2; j < 8; j++ ) {
            big_list[bl_index++] = list[j];
        }
    }

    sort( big_list.begin(), big_list.end() );
    print( big_list[0] );
    print( big_list[1] );

    return 0;
}