#include <bits/stdc++.h>
using namespace std;
  
// #define int long long
#define pb push_back
#define print(Target) cout << Target << '\n'

#define REP(i, n) for (int i = 0; i < (n); i++)
#define REPS(i, a, n) for (int i = (a); i < (n); i++)

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;

bool is_uruu(int y) {return (y % 4 == 0 && (y % 100 != 0 || y % 400 == 0));}

struct INFO{
  int num;
  double t;
};

bool cmp(INFO lhs, INFO rhs)
{
  return (lhs.t < rhs.t);
}

signed main()
{
  ios::sync_with_stdio(false);
  vector<INFO> lose;

  REP(i, 3){
    vector<INFO> info;
    REP(j, 8){
      int num; double t;
      cin >> num >> t;
      info.pb((INFO){num, t});
    }
    sort(info.begin(), info.end(), cmp);
    REP(j, 2){
      cout << info[j].num << " " << info[j].t << '\n';
    }
    REPS(j, 2, 8){
      lose.pb(info[j]);
    }
  }
  sort(lose.begin(), lose.end(), cmp);
  REP(i, 2){
    cout << lose[i].num << " " << lose[i].t << '\n';
  }

  return (0);
}