Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	race1 := make([]player, 8)
	race2 := make([]player, 8)
	race3 := make([]player, 8)
	rest := make([]player, 6)
	for i := 0; i < 8; i++ {
		scanner.Scan()
		input := strings.Split(scanner.Text(), " ")
		no, _ := strconv.Atoi(input[0])
		time, _ := strconv.ParseFloat(input[1], 64)
		race1[i] = player{no, time}
	}
	for i := 0; i < 8; i++ {
		scanner.Scan()
		input := strings.Split(scanner.Text(), " ")
		no, _ := strconv.Atoi(input[0])
		time, _ := strconv.ParseFloat(input[1], 64)
		race2[i] = player{no, time}
	}
	for i := 0; i < 8; i++ {
		scanner.Scan()
		input := strings.Split(scanner.Text(), " ")
		no, _ := strconv.Atoi(input[0])
		time, _ := strconv.ParseFloat(input[1], 64)
		race3[i] = player{no, time}
	}
	for i := 1; i <= 7; i++ {
		for k := 7; k >= i; k-- {
			if race1[k].time < race1[k-1].time {
				race1[k], race1[k-1] = race1[k-1], race1[k]
			}
			if race2[k].time < race2[k-1].time {
				race2[k], race2[k-1] = race2[k-1], race2[k]
			}
			if race3[k].time < race3[k-1].time {
				race3[k], race3[k-1] = race3[k-1], race3[k]
			}
		}
	}
	rest[0] = race1[2]
	rest[1] = race1[3]
	rest[2] = race2[2]
	rest[3] = race2[3]
	rest[4] = race3[2]
	rest[5] = race3[3]
	for i := 1; i <= 5; i++ {
		for k := 5; k >= i; k-- {
			if rest[k].time < rest[k-1].time {
				rest[k],rest[k-1] = rest[k-1], rest[k]
			}
		}
	}
	fmt.Printf("%d %.2f\n", race1[0].no, race1[0].time)
	fmt.Printf("%d %.2f\n", race1[1].no, race1[1].time)
	fmt.Printf("%d %.2f\n", race2[0].no, race2[0].time)
	fmt.Printf("%d %.2f\n", race2[1].no, race2[1].time)
	fmt.Printf("%d %.2f\n", race3[0].no, race3[0].time)
	fmt.Printf("%d %.2f\n", race3[1].no, race3[1].time)
	fmt.Printf("%d %.2f\n", rest[0].no, rest[0].time)
	fmt.Printf("%d %.2f\n", rest[1].no, rest[1].time)
}

type player struct {
	no int
	time float64
}

C++: #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);
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <climits>
#include <sstream>
using namespace std;

#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;

template <class T>
void initvv(vector<vector<T> > &v,int a,int b, const T  &t = T()){
	v.assign(a,vector<T>(b,t));
}

//v.erase(unique(v.begin(),v.end()),v.end());
typedef pair<double,int> tmp;

int main(){
	vector<tmp> ans;
	vector<tmp> v;
	rep(i,3){
		vector<tmp> tt(8);
		rep(j,8){
			cin>>tt[j].S>>tt[j].F;
			// cout<<tt[i].F<<endl;
		}
		sort(ALL(tt));
		ans.PB(tt[0]);
		ans.PB(tt[1]);
		// cout<<ans
		v.PB(tt[2]);
	}
	sort(ALL(v));
	ans.PB(v[0]);
	ans.PB(v[1]);
	rep(i,8){
		printf("%d %.2f\n",ans[i].S,ans[i].F);
		// cout<<ans[i].S<<" "<<ans[i].F<<endl;
	}
}

C++: #include<iostream>
#include<fstream>
#include<sstream>
#include<cstdio>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstring>
#include<cstdlib>
#include<climits>
#include<utility>
#include<cctype>
using namespace std;

#define ull unsigned long long
#define stt(it,order) sort(it.begin(),it.end(),order)
#define st(it) sort(it.begin(),it.end())
#define ll long long
#define rep(i,j) for(int i=0;i<j;++i)
#define loop(i,a,j) for(int i=a;i<j;++i)
#define mpi(it,table,T,E) for(map<T,E>::iterator it = table.begin();it!=table.end();++it)
#define PI 3.141592654
/*
ifstream fin("input.txt");
ofstream fout("output.txt");
#define cin fin
#define cout fout
*/

struct data{
	int i;
	double t;
};

bool order(data a,data b){
	return a.t < b.t;
}

vector<data> a;
vector<data> b;
vector<data> c;
vector<data> e;

int main(){
	data tmp;
	while(scanf("%d %lf",&tmp.i,&tmp.t) != EOF){
		a.clear();b.clear();c.clear();e.clear();
		a.push_back(tmp);
		rep(i,7){
			scanf("%d %lf",&tmp.i,&tmp.t);
			a.push_back(tmp);
		}
		rep(i,8){
			scanf("%d %lf",&tmp.i,&tmp.t);
			b.push_back(tmp);
		}
		rep(i,8){
			scanf("%d %lf",&tmp.i,&tmp.t);
			c.push_back(tmp);
		}
		stt(a,order);
		stt(b,order);
		stt(c,order);
		printf("%d %.2f\n",a[0].i,a[0].t);
		printf("%d %.2f\n",a[1].i,a[1].t);
		printf("%d %.2f\n",b[0].i,b[0].t);
		printf("%d %.2f\n",b[1].i,b[1].t);
		printf("%d %.2f\n",c[0].i,c[0].t);
		printf("%d %.2f\n",c[1].i,c[1].t);
		
		e.push_back(a[2]);
		e.push_back(b[2]);
		e.push_back(c[2]);
		stt(e,order);
		printf("%d %.2f\n",e[0].i,e[0].t);
		printf("%d %.2f\n",e[1].i,e[1].t);
		
	}
	return 0;
}