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

typedef pair<double, int> P;

int main()
{
    int n;
    double t;
    vector<P> v;
    vector<P>::iterator it;
    for(int i = 0; i < 3; i++) {
        vector<P> vt;
        for(int j = 0; j < 8; j++) {
            cin >> n >> t;
            vt.push_back(P(t, n));
        }

        sort(vt.begin(), vt.end());

        it = vt.begin();
        for(int j = 0; j < 2; j++) {
            cout << (*it).second << " " << (*it).first << endl;
            it = vt.erase(it);
        }

        for(it = vt.begin(); it != vt.end(); it++)
            v.push_back((*it));
    }

    sort(v.begin(), v.end());
    it = v.begin();
    for(int i = 0; i < 2; i++) {
        cout << (*it).second << " " << (*it).first << endl;
        it++;
    }

}