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

typedef vector<int> VI;
typedef vector<VI> VII;
typedef pair<int, int> PII;
typedef long long ll;

#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back;
#define MP make_pair

const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = INT_MAX / 3;

int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, -1, 0, 1};

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

typedef pair<double, int> P;

vector<P> a;

int main(void){
  for(int i = 0; i < 3; i++){
    vector<P> p(8, P(0.0, 0));
    for(int j = 0; j < 8; j++) cin >> p[j].second >> p[j].first;
    sort(ALL(p));
    cout << p[0].second << " " << p[0].first << endl;
    cout << p[1].second << " " << p[1].first << endl;
    p.erase(p.begin()); p.erase(p.begin());
    a.insert(a.begin(), p.begin(), p.end());
  }
  sort(ALL(a));
  cout << a[0].second << " " << a[0].first << endl;
  cout << a[1].second << " " << a[1].first << endl;
  return 0;
}