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;};
#define  RR 2;
int main()
{
	
ply NUM[4][9],M1,M2,M3,T;
for(int ii=0;ii<3;ii++)
{
	
	for(int i=0;i<8;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<8;i++){
		for(int j=7;j>i;j--){
			if(NUM[ii][j-1].A>NUM[ii][j].A){ply Te=NUM[ii][j];NUM[ii][j]=NUM[ii][j-1];NUM[ii][j-1]=Te;}
		}
	}
}
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<3;i++){
		for(int j=0;j<8;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 <stdio.h>
#include <math.h>
int main(){
    int i,ban[25],t=0,s,ment[2]={0};
    double time[25],max[2]={999},memory[3][2];
    for(i=1;i<=24;i++){
        scanf("%d %lf",&ban[i],&time[i]);
        if(max[0]>time[i]){
            max[1]=max[0];
            max[0]=time[i];
        }else{
            if(max[1]>time[i]){
                max[1]=time[i];
            }
        }
        if(i%8==0){
            for(s=0;s<2;s++){
                memory[t][s]=max[s];
            }
            t++;
            max[0]=999;max[1]=999;
        }
    }
    for(i=0;i<3;i++){
        for(t=0;t<2;t++){
            for(s=1;s<=24;s++){
                if(time[s]==memory[i][t]) break;
            }
            printf("%d %.2f\n",ban[s],memory[i][t]);
        }
    }
    max[1]=999;max[0]=999;
    for(s=1;s<=24;s++){
        if(time[s]!=memory[0][0]&&time[s]!=memory[0][1]&&time[s]!=memory[1][0]&&time[s]!=memory[1][1]&&time[s]!=memory[2][0]&&time[s]!=memory[2][1]){
            if(max[0]>time[s]){
                max[1]=max[0];
                ment[1]=ment[0];
                max[0]=time[s];
                ment[0]=s;
            }else{
                if(max[1]>time[i]){
                    max[1]=time[i];
                    ment[1]=s;
                }
            }
        }
        
    }
    printf("%d %.2f\n",ban[ment[0]],max[0]);
    printf("%d %.2f\n",ban[ment[1]],max[1]);
    return 0;
}

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


//選手のタイムを返す構造体
typedef struct struct_sensyu
{
	int number;
	double time;
}S_sensyu;



int main(void)
{
	//構造体の宣言
	S_sensyu s_sensyu[3][8];

	//tmp実体
	S_sensyu s_tmp , s_tmp2;

	//構造体ポインタ
	S_sensyu *ptr_sensyu = &s_tmp;
	S_sensyu *ptr_sensyu2 = &s_tmp2;

	//考えるのが面倒なので18個構造体を宣言
	S_sensyu s_output2[6];

	//入力
	for (int i = 0; i < 3; i++)
	{
		for (int j = 0; j < 8; j++)
		{
			cin >> s_sensyu[i][j].number >> s_sensyu[i][j].time;
		}
	}

	//ソート
	for (int i = 0; i < 3; i++)
	{
		for (int j = 0; j < 7; j++)
		{
			for (int k = j + 1; k < 8; k++)
			{
				//タイムが早い順に入れ替える
				if (s_sensyu[i][j].time > s_sensyu[i][k].time)
				{
					*ptr_sensyu = s_sensyu[i][j];
					*ptr_sensyu2 = s_sensyu[i][k];
					s_sensyu[i][j] = *ptr_sensyu2;
					s_sensyu[i][k] = *ptr_sensyu;
				}
			}
		}
	}

	//まず最初に出力
	for (int i = 0; i < 3; i++)
	{
		for (int j = 0; j < 2; j++)
		{
			printf("%d %.2lf\n" , s_sensyu[i][j].number , s_sensyu[i][j].time);
		}
	}

	//カウント変数
	int count = 0;
	for (int i = 0; i < 3; i++)
	{
		for (int j = 2; j <= 3; j++)
		{
			//ポインタを利用して高速化
			*ptr_sensyu = s_sensyu[i][j];
			s_output2[count++] = *ptr_sensyu;
		}
	}

	//再びソート
	for (int i = 0; i < 5; i++)
	{
		for (int j = i + 1; j < 6; j++)
		{
			//タイムが早い順
			if (s_output2[i].time > s_output2[j].time)
			{
				*ptr_sensyu = s_output2[i];
				*ptr_sensyu2 = s_output2[j];
				s_output2[i] = *ptr_sensyu2;
				s_output2[j] = *ptr_sensyu;
			}
		}
	}

	//再び出力
	for (int i = 0; i < 2; i++)
	{
		printf("%d %.2lf\n" , s_output2[i].number , s_output2[i].time);
	}

	return 0;
}

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

typedef pair<double, int> P;

int main()
{
    int n;
    double t;
    vector<P> v;
    vector<P>::iterator it;
    for(int i = 0; i < 3; i++) {
        vector<P> vt;
        for(int j = 0; j < 8; j++) {
            cin >> n >> t;
            vt.push_back(P(t, n));
        }

        sort(vt.begin(), vt.end());

        it = vt.begin();
        for(int j = 0; j < 2; j++) {
            cout << (*it).second << " " << (*it).first << endl;
            it = vt.erase(it);
        }

        for(it = vt.begin(); it != vt.end(); it++)
            v.push_back((*it));
    }

    sort(v.begin(), v.end());
    it = v.begin();
    for(int i = 0; i < 2; i++) {
        cout << (*it).second << " " << (*it).first << endl;
        it++;
    }

}