#include<iostream>
#include<map>
#include<algorithm>
#include<stdio.h>

using namespace std;

int main(){

  double time[24];
  int num;

  map <double, int> M;

  for(int i = 0; i < 3; i++){
    for(int j = i*8; j < i*8+8; j++){
      cin >> num >> time[j];
      M[time[j]] = num;
    }

    sort(time+i*8, time+i*8+8);

    for(int j = i*8; j < i*8+2; j++){
      printf("%d %.2f\n",M[time[j]],time[j]);
      time[j] = -1;
    }
  }

  sort(time, time+24);

  int j = 0;

  for(int i = 0; j < 2; i++){
    if(time[i] > 0){
      printf("%d %.2f\n",M[time[i]],time[i]);
      j++;
    }
  }
  return 0;

}