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

int main(){
    vector<pair<double, int>> p1(8);
    vector<pair<double, int>> p2(8);
    vector<pair<double, int>> p3(8);
    for(int i = 0;i<8;i++){
        cin >> p1[i].second >> p1[i].first;
    }
    for(int i = 0;i<8;i++){
        cin >> p2[i].second >> p2[i].first;
    }
    for(int i = 0;i<8;i++){
        cin >> p3[i].second >> p3[i].first;
    }
    sort(p1.begin(), p1.end());
    sort(p2.begin(), p2.end());
    sort(p3.begin(), p3.end());
    cout << p1[0].second << " " << p1[0].first << endl;
    cout << p1[1].second << " " << p1[1].first << endl;
    cout << p2[0].second << " " << p2[0].first << endl;
    cout << p2[1].second << " " << p2[1].first << endl;
    cout << p3[0].second << " " << p3[0].first << endl;
    cout << p3[1].second << " " << p3[1].first << endl;
    p1.erase(p1.begin(), p1.begin()+2);
    p2.erase(p2.begin(), p2.begin()+2);
    p3.erase(p3.begin(), p3.begin()+2);
    // copy(p2.begin(), p2.end(), back_inserter(p1));
    // copy(p2.begin(), p2.end(), back_inserter(p1));
    p1.insert(p1.end(), p2.begin(), p2.end());
    p1.insert(p1.end(), p3.begin(), p3.end());
    sort(p1.begin(), p1.end());
    cout << p1[0].second << " " << p1[0].first << endl;
    cout << p1[1].second << " " << p1[1].first << endl;
    return 0;
}