#include <bits/stdc++.h>

using namespace std;
typedef pair<double, int> P;

int main(void) {
  vector<P> v[3], loser;
  for (int i = 0; i < 3; i++) {
    v[i].resize(8);
    for (int j = 0; j < 8; j++) {
      cin >> v[i][j].second >> v[i][j].first;
    }
    sort(v[i].begin(), v[i].end());

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

    for (int j = 2; j < 8; j++) {
      loser.push_back(v[i][j]);
    }
  }

  sort(loser.begin(), loser.end());

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

  return 0;
}
