#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
using namespace std;

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)

struct Player {
  int number;
  float rec;
  bool operator<(const Player& a) const { return rec < a.rec; }
};

int main() {
  vector<Player> v;
  rep (i,3) {
    Player players[8];
    rep (j,8) {
      cin >> players[j].number >> players[j].rec;
    }
    sort(players, players + 8);
    rep (j,2) {
      printf("%d %.2lf\n", players[j].number, players[j].rec);
    }
    v.push_back(players[2]);
  }
  sort(v.begin(), v.end());
  rep (i,2) {
    printf("%d %.2lf\n", v[i].number, v[i].rec);
  }
  return 0;
}