#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define MEMBER 8
#define CLASS 3
#define COLUMN 2
#define swap(type, x, y) do{type temp = x; x = y; y = temp;}while(0);
using namespace std;

typedef struct {
    int bnum;
    double time;
}member;

void quick_sort(member *p, int left, int right);
int main(void) {
    member x[CLASS][MEMBER];
    member temp[MEMBER];
    member under[6];
    int i, j;
    
    for(i = 0; i < CLASS; i++) {
        for(j = 0; j < MEMBER; j++) {
            scanf("%d %lf", &temp[j].bnum, &temp[j].time);
        }
        quick_sort(temp, 0, MEMBER - 1);

        for(j = 0; j < MEMBER; j++)
            x[i][j] = temp[j];
    }
    
    int count = 0;
    for(i = 0; i < CLASS; i++) {
        for(j = 2; j < 4; j++) {
            under[count++] = x[i][j];
        }
    }
    
    quick_sort(under, 0, 5);
    
    for(i = 0; i < CLASS; i++)
        for(j = 0; j < COLUMN; j++)
            printf("%d %.2f\n", x[i][j].bnum, x[i][j].time);
    for(i = 0; i < 2; i++)
        printf("%d %.2f\n", under[i].bnum, under[i].time);
    
    return(0);
}

void quick_sort(member *p, int left, int right) {
    int i, j;
    double pivot;
    
    i = left;
    j = right;
    pivot = p[(left + right) / 2].time;
    
    while(1) {
        while(p[i].time < pivot) i++;
        while(p[j].time > pivot) j--;
        
        if(i >= j) break;
        
        swap(int, p[i].bnum, p[j].bnum);
        swap(double, p[i].time, p[j].time);
        i++;
        j--;
    }
    if(i - 1 > left) quick_sort(p, left, i - 1);
    if(j + 1 < right) quick_sort(p, j + 1, right);
}