#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main(){
    int undern[2];
    double under[2]={999999,999999};
    for(int a = 0; a < 3; a++){
        double place[4] = {999999,999999,999999,999999};
        int    placen[4] = {999999,999999,999999,999999};
        for(int b = 0; b < 8; b++){
            int n;double t;
            cin >> n >> t;
            if(t < place[0]){
                swap(placen[0],n);
                swap(place[0],t);
            }
            if(t < place[1]){
                swap(placen[1],n);
                swap(place[1],t);
            }
            if(t < place[2]){
                swap(placen[2],n);
                swap(place[2],t);
            }
            if(t < place[3]){
                place[3] = t;
                placen[3] = n;
            }
        }
        cout << fixed << setprecision(2) << placen[0] << ' ' << place[0] << endl;
        cout << fixed << setprecision(2) << placen[1] << ' ' << place[1] << endl;
        if(place[2] < under[0]){
            swap(place[2],under[0]);
            swap(placen[2],undern[0]);
        }
        if(place[2] < under[1]){
            swap(place[2],under[1]);
            swap(placen[2],undern[1]);
        }
        if(place[3] < under[0]){
            swap(place[3],under[0]);
            swap(placen[3],undern[0]);
        }
        if(place[3] < under[1]){
            swap(place[3],under[1]);
            swap(placen[3],undern[1]);
        }
    }
    cout << fixed << setprecision(2) << undern[0] << ' ' << under[0] << endl;
    cout << fixed << setprecision(2) << undern[1] << ' ' << under[1] << endl;
    return 0;
}
