#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    vector<pair<double, pair<int, int> > > data(24);

    for(int i=0; i<24; ++i){
        cin >> data[i].second.first >> data[i].first;
        data[i].second.second = i/8;
    }
    sort(data.begin(), data.end());

    vector<vector<pair<double, int> > > winner(4);
    for(int i=0; i<24; ++i){
        int j = data[i].second.second;
        if(winner[j].size() < 2)
            winner[j].push_back(make_pair(data[i].first, data[i].second.first));
        else if(winner[3].size() < 2)
            winner[3].push_back(make_pair(data[i].first, data[i].second.first));
    }

    for(int i=0; i<4; ++i){
        for(int j=0; j<2; ++j){
            printf("%d %.2f\n", winner[i][j].second, winner[i][j].first);
        }
    }

    return 0;
}