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

pair<double, int> a[8], b[6], c[8];

int main()
{
    for (int j = 0; j < 3; j++) {
        for (int i = 0; i < 8; i++)
            cin >> a[i].second >> a[i].first;

        sort(a, a + 8);

        for (int i = 0; i < 2; i++) {
            c[j * 2 + i] = a[i]; 
            b[j * 2 + i] = a[i + 2];
        }
    }

    sort(b, b + 6);

    c[6] = b[0];
    c[7] = b[1];

    for (int i = 0; i < 8; i++)
        cout << c[i].second << " "
        << setiosflags(ios::fixed | ios::showpoint) << setprecision(2)
        << c[i].first << endl;

    return 0;
}

