#include <cstdio>
#include <utility>
#include <algorithm>

using namespace std;

//pairを2つ操作。トラック辺り３位以下を保存しておく。

int main()
{
    pair<double,int> p1[8], p2[18];
    int repeat = 0;
    for( int i = 0; i < 8; i++ )
    {
        scanf( "%d %lf\n", &p1[i].second, &p1[i].first );
    }
    sort( p1, p1 + 8 );
    for( int i = 2; i < 8; i++ )
    {
        p2[i - 2].first = p1[i].first;
        p2[i - 2].second = p1[i].second;
    }
    printf( "%d %.2lf\n%d %.2lf\n", p1[0].second, p1[0].first, p1[1].second, p1[1].first );
    for( int i = 0; i < 8; i++ )
    {
        scanf( "%d %lf\n", &p1[i].second, &p1[i].first );
    }
    sort( p1, p1 + 8 );
    for( int i = 6; i < 12; i++ )
    {
        p2[i].first = p1[i - 4].first;
        p2[i].second = p1[i - 4].second;
    }
    printf( "%d %.2lf\n%d %.2lf\n", p1[0].second, p1[0].first, p1[1].second, p1[1].first );
    for( int i = 0; i < 8; i++ )
    {
        scanf( "%d %lf\n", &p1[i].second, &p1[i].first );
    }
    sort( p1, p1 + 8 );
    for( int i = 12; i < 18; i++ )
    {
        p2[i].first = p1[i- 10].first;
        p2[i].second = p1[i - 10].second;
    }
    printf( "%d %.2lf\n%d %.2lf\n", p1[0].second, p1[0].first, p1[1].second, p1[1].first );
    sort( p2, p2 + 18 );
    printf( "%d %.2lf\n%d %.2lf\n", p2[0].second, p2[0].first, p2[1].second, p2[1].first );
    return 0;
}
