#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
typedef pair<double, int> P;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(2);
    vector<P> ans;
    priority_queue<P, vector<P>, greater<P>> que;
    for(int i = 0; i < 3; i++)
    {
        priority_queue<P, vector<P>, greater<P>> tmp;
        for(int j = 0; j < 8; j++)
        {
            int p; cin >> p;
            double t; cin >> t;
            tmp.push(P(t, p));
        }
        ans.push_back(tmp.top()); tmp.pop();
        ans.push_back(tmp.top()); tmp.pop();
        while(tmp.size())
        {
            que.push(tmp.top());
            tmp.pop();
        }
    }
    for(int i = 0; i < 6; i++)
    {
        ans.push_back(que.top());
        que.pop();
    }
    for(int i = 0; i < 8; i++) cout << ans[i].second << " " << ans[i].first << endl;
    return 0;
}


