#include <bits/stdc++.h>

using namespace std;

int main() {
  int num; double time;
  
  vector<pair<double, int> > last;
  
  { 
    vector<pair<double, int> > score(8);
    
    for(int i=0; i<8; i++) {
      cin >> num >> time;
      score[i] = make_pair(time, num);
    }
    sort(score.begin(), score.end());
    
    for(int i=0; i<2; i++) {
      printf("%d %.2f\n", score[i].second, score[i].first);
    }
    
    for(int i=2; i<8; i++) {
      last.push_back(score[i]);
    }
  }
  
  { 
    vector<pair<double, int> > score(8);
    
    for(int i=0; i<8; i++) {
      cin >> num >> time;
      score[i] = make_pair(time, num);
    }
    sort(score.begin(), score.end());
    
    for(int i=0; i<2; i++) {
      printf("%d %.2f\n", score[i].second, score[i].first);
    }
    
    for(int i=2; i<8; i++) {
      last.push_back(score[i]);
    }
  }
  
  { 
    vector<pair<double, int> > score(8);
    
    for(int i=0; i<8; i++) {
      cin >> num >> time;
      score[i] = make_pair(time, num);
    }
    sort(score.begin(), score.end());
    
    for(int i=0; i<2; i++) {
      printf("%d %.2f\n", score[i].second, score[i].first);
    }
    
    for(int i=2; i<8; i++) {
      last.push_back(score[i]);
    }
  }
  
  sort(last.begin(), last.end());
  
  for(int i=0; i<2; i++) {
    printf("%d %.2f\n", last[i].second, last[i].first);
  }
  
  return 0;
}