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<stdio.h>
#include<iostream>
using namespace std;

struct ply{int cl;int nu;int m;int s;int A;};

int main()
{

ply NUM[4][25],M1,M2,M3,T;
for(int ii=0;ii<3;ii++)
{
	
	for(int i=0;i<7;i++)
	{
		NUM[ii][i].cl=ii;
		scanf("%d %d.%d",&NUM[ii][i].nu,&NUM[ii][i].m,&NUM[ii][i].s);
		NUM[ii][i].A=100*NUM[ii][i].m+NUM[ii][i].s;
	}
	for(int i=0;i<7;i++){
		for(int j=7;j>i;j--){
			if(NUM[ii][i].A>NUM[ii][j].A)swap(NUM[ii][i],NUM[ii][j]);
		}
	}
}
M1=NUM[0][2];M2=NUM[1][2];M3=NUM[2][2];
if(M1.A<M2.A)swap(M1,M2);
if(M1.A<M3.A)swap(M1,M3);
if(M2.A<M3.A)swap(M2,M3);
for(int i=0;i<2;i++){
		for(int j=0;j<1;j++){
			if(NUM[i][j].s/10>0)cout<<NUM[i][j].nu<<" "<<NUM[i][j].m<<"."<<NUM[i][j].s<<endl;
			else if(NUM[i][j].s/10==0)cout<<NUM[i][j].nu<<" "<<NUM[i][j].m<<"."<<"0"<<NUM[i][j].s<<endl;
		}
}
if(M3.s/10>0)cout<<M3.nu<<" "<<M3.m<<"."<<M3.s<<endl;
else if(M3.s/10==0)cout<<M3.nu<<" "<<M3.m<<"."<<"0"<<M3.s<<endl;

if(M2.s/10>0)cout<<M2.nu<<" "<<M2.m<<"."<<M2.s<<endl;
else if(M2.s/10==0)cout<<M2.nu<<" "<<M2.m<<"."<<"0"<<M2.s<<endl;

return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;

set<int> si;
vector<pair<double, ll>> vdx[3], vd;
double t;
ll n;

int main(){
	REP(i, 3){
		REP(j, 8){
			cin >> n >> t;
			vdx[i].push_back(make_pair(t, n));
			vd.push_back(make_pair(t, n));
		}
		sort(ALL(vdx[i]));
	}
	sort(ALL(vd));
	REP(i, 3){
		REP(j, 2){
			cout << vdx[i][j].second << " " << vdx[i][j].first << endl;
			si.insert(vdx[i][j].second);
		}
	}
	int co = 0;
	REP(i, 24){
		if (si.find(vd[i].second) == si.end()){
			cout << vd[i].second << " " << vd[i].first << endl;
			co++;
		}
		if (co >= 2)break;
	}
}

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <fstream>
#include <sstream>
#include <math.h>
#include <queue>
#include <stack>
#include <math.h>
#include <string.h>


struct p{
    int num;
    double time;
};

using namespace std;

bool f(p l, p r){
    return l.time<r.time;
}

int main(){
    vector<p> haisya;
    for(int roop=0; roop<3; roop++){
        vector<p> in;
        
        for(int roop2=0; roop2<8; roop2++){
            p temp;
            cin>>temp.num>>temp.time;
            in.push_back(temp);
        }
        sort(in.begin(), in.end(), f);
        cout<<in[0].num<<" "<<in[0].time<<endl;
        cout<<in[1].num<<" "<<in[1].time<<endl;
        for(int roop2=2; roop2<8; roop2++){
            haisya.push_back(in[roop2]);
        }
    }
    sort(haisya.begin(), haisya.end(), f);
    cout<<haisya[0].num<<" "<<haisya[0].time<<endl;
    cout<<haisya[1].num<<" "<<haisya[1].time<<endl;

}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;

typedef pair<int, double> i_d;
#define rep(i, n)for((i) = 0;(i) < (n);++(i))

bool dsort(i_d qwe, i_d rty){
	return qwe.second < rty.second;
}
i_d pt[3][8], f[18];
int hd = 0;

int main(void){
	int i, j, n = 24;
	rep(i, n)scanf("%d %lf", &pt[i/8][i%8].first, &pt[i/8][i%8].second);
	rep(i, 3)sort(pt[i], pt[i] + 8, dsort);
	rep(i, 3)rep(j, 8){
		if(j < 2)printf("%d %.2lf\n", pt[i][j].first, pt[i][j].second);
		else f[hd++] = pt[i][j];
	}
	sort(f, f + hd, dsort);
	rep(i, 2)printf("%d %.2lf\n", f[i].first, f[i].second);

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <utility>

using namespace std;

typedef long long ll;

int main(){
	vector<vector<pair<double, int> >> v(3, vector<pair<double, int> >(8));
	vector<pair<double, int> > u;
	for (int i = 0; i < 3; i++){
		for (int j = 0; j < 8; j++){
			cin >> v[i][j].second >> v[i][j].first;
		}
		sort(v[i].begin(), v[i].end());
		cout << v[i][0].second << " " << v[i][0].first << endl;
		cout << v[i][1].second << " " << v[i][1].first << endl;
		for (int j = 2; j < 8; j++){
			u.push_back(v[i][j]);
		}
	}
	sort(u.begin(), u.end());
	cout << u[0].second << " " << u[0].first << endl;
	cout << u[1].second << " " << u[1].first << endl;
}