#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstring>
#include<cstdio>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()

typedef pair<double, int> pp;

int main()
{
    vector<pp> t[3];
    vector<pp> ans;
    vector<pp> rest;

    double d;
    int n;
    REP(3)
    {
        rep(j,8)
        {
            cin >> n >> d;
            t[i].push_back(pp(d,n));
        }
        sort(all(t[i]));
        printf("%d %.2f\n", t[i][0].second, t[i][0].first);
        printf("%d %.2f\n", t[i][1].second, t[i][1].first);
        //ans.push_back(t[i][0]); ans.push_back(t[i][1]);
        for(int s = 2;s<8;s++)rest.push_back(t[i][s]);
    }
    sort(all(rest));
    //ans.push_back(rest[0]); ans.push_back(rest[1]);
    printf("%d %.2f\n", rest[0].second, rest[0].first);
    printf("%d %.2f\n", rest[1].second, rest[1].first);

    sort(all(ans));
    //REP(8) printf("%d %.2f", ans[i].second, ans[i].first);
    return 0;
}