#include <iostream>
#include <map>
#include <iomanip>
using namespace std;
class Data {
    public:
        Data(int max);
        ~Data();
        void add(int, double);
        int getNum(int n);
        double getTime(int n);

    private:
        int* num;
        double* time;
        int max;
        int now_n;
};
Data::Data(int max){
    num = new int[max];
    time = new double[max];
    for(int i = 0; i < max; ++i) {
        num[i] = 0;
        time[i] = 0;
    }
    this->max = max;
    now_n = 0;
}
Data::~Data(){
    delete num;
    delete time;
}
void Data::add(int n, double t){
    if (now_n >= max) {
        return;
    }
    num[now_n] = n;
    time[now_n] = t;
    ++now_n;
}
int Data::getNum(int n){
    return num[n];
}
double Data::getTime(int n){
    return time[n];
}
#define MEMBER 8
#define RACE 3
int main(){
    map<double, int> course, ans, tmp;
    int num;
    double in;
    Data data(MEMBER);
    int count;
    int race = RACE;
    while(race--) {
        course.clear();
        for (int i = 0; i < MEMBER; i++) {
            cin >> num >> in;
            course.insert( map<double, int>::value_type(in , num));
        }
        count = 0;
        for(map<double, int>::iterator it = course.begin(); it != course.end(); ++it) {
            if ((count++) < 2) {
                data.add(it->second , it->first);
            }
            else {
                tmp.insert( map<double, int>::value_type(it->first, it->second));
            }
        }
    }
    count = 2;
    for(map<double, int>::iterator it = tmp.begin(); it != tmp.end(); ++it) {
        if (count-- <= 0) {
            break;
        }
        data.add(it->second, it->first);
    }
    //output
    for(int i = 0; i < MEMBER; ++i) {
        cout<< showpoint << data.getNum(i) << " " << setprecision(4) << data.getTime(i) << endl;
    }
}