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

int main() {
    vector<pair<double,int> > t;
    for (int i=0; i<3; ++i) {
        vector<pair<double,int> > tt(8);
        for (int j=0; j<8; ++j) {
            cin >> tt[j].second >> tt[j].first;
        }
        sort(tt.begin(), tt.end());
        cout.precision(2);
        cout << fixed;
        cout << tt[0].second << " " << tt[0].first << endl;
        cout << tt[1].second << " " << tt[1].first << endl;
        for (int j=2; j<8; ++j) {
            t.push_back(tt[j]);
        }
    }
    sort(t.begin(), t.end());
    cout.precision(2);
    cout << fixed;
    cout << t[0].second << " " << t[0].first << endl;
    cout << t[1].second << " " << t[1].first << endl;
    return 0;
}