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

typedef pair<double, int> data;

int main() {
    vector<data> a, b, c;
    vector<data> all;
    for (int i = 0; i < 8; i++) {int n; double time; cin >> n >> time; a.push_back(make_pair(time, n));}
    for (int i = 0; i < 8; i++) {int n; double time; cin >> n >> time; b.push_back(make_pair(time, n));}
    for (int i = 0; i < 8; i++) {int n; double time; cin >> n >> time; c.push_back(make_pair(time, n));}
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    sort(c.begin(), c.end());
    all.insert(all.end(), a.begin()+2, a.end());
    all.insert(all.end(), b.begin()+2, b.end());
    all.insert(all.end(), c.begin()+2, c.end());
    sort(all.begin(), all.end());
    cout.setf(ios::showpoint);
    cout.precision(4);
    cout << a[0].second << ' ' << a[0].first << endl;
    cout << a[1].second << ' ' << a[1].first << endl;
    cout << b[0].second << ' ' << b[0].first << endl;
    cout << b[1].second << ' ' << b[1].first << endl;
    cout << c[0].second << ' ' << c[0].first << endl;
    cout << c[1].second << ' ' << c[1].first << endl;
    cout << all[0].second << ' ' << all[0].first << endl;
    cout << all[1].second << ' ' << all[1].first << endl;
    return 0;
}

    