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 <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

int n;
double t[24],u[3][8],v[6];
map<double,int> m;

int main(){
	for(int i=0;i<24;i++){
		cin>>n>>t[i];
		u[i/8][i%8]=t[i];
		m[t[i]]=n;
	}
	for(int i=0;i<3;i++)sort(u[i],u[i]+8);
	for(int i=0;i<6;i++){
		double tt=u[i/2][i%2];
		cout<<m[tt]<<" ";
		if((int)(tt*100+0.1)%10)cout<<tt<<endl;
		else if((int)(tt*10)%10)cout<<tt<<"0"<<endl;
		else cout<<tt<<".00"<<endl;
		v[i]=tt;
	}
	for(int i=0;i<24;i++)for(int j=0;j<6;j++)if(t[i]==v[j])t[i]=2e+9;
	sort(t,t+24);
	for(int i=0;i<2;i++){
		double tt=t[i];
		cout<<m[tt]<<" ";
		if((int)(tt*100+0.1)%10)cout<<tt<<endl;
		else if((int)(tt*10)%10)cout<<tt<<"0"<<endl;
		else cout<<tt<<".00"<<endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(void){
    std::map<double, int> map4;
    int p;
    double t;
    std::map<double, int> map1;
    for (int i=0;i<8;i++) {
        cin>>p>>t;
        map1.insert(make_pair(t,p));
    }
    auto itr1=map1.begin();
    printf("%d",itr1->second);
    cout<<" ";
    printf("%.2f",itr1->first);
    cout<<endl;
    itr1=next(itr1,1);
    printf("%d",itr1->second);
    cout<<" ";
    printf("%.2f",itr1->first);
    cout<<endl;
    
    
    std::map<double, int> map2;
    for (int j=0;j<8;j++) {
        cin>>p>>t;
        map2.insert(make_pair(t,p));
    }
    auto itr2=map2.begin();
    printf("%d",itr2->second);
    cout<<" ";
    printf("%.2f",itr2->first);
    cout<<endl;
    itr2=next(itr2,1);
    printf("%d",itr2->second);
    cout<<" ";
    printf("%.2f",itr2->first);
    cout<<endl;
    
    
    std::map<double, int> map3;
    for (int j=0;j<8;j++) {
        cin>>p>>t;
        map3.insert(make_pair(t,p));
    }
    auto itr3=map3.begin();
    printf("%d",itr3->second);
    cout<<" ";
    printf("%.2f",itr3->first);
    cout<<endl;
    itr3=next(itr3,1);
    printf("%d",itr3->second);
    cout<<" ";
    printf("%.2f",itr3->first);
    cout<<endl;
    
    for (int k=0;k<6;k++) {
        itr1=next(itr1,1);
        map4.insert(make_pair(itr1->first,itr1->second));
        itr2=next(itr2,1);
        map4.insert(make_pair(itr2->first,itr2->second));
        itr3=next(itr3,1);
        map4.insert(make_pair(itr3->first,itr3->second));
    }
    
    auto itr4=map4.begin();
    printf("%d",itr4->second);
    cout<<" ";
    printf("%.2f",itr4->first);
    cout<<endl;
    itr4=next(itr4,1);
    printf("%d",itr4->second);
    cout<<" ";
    printf("%.2f",itr4->first);
    cout<<endl;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
	double a;
	int n;
	vector<pair<double,int> > lose;
	for(int i=0;i<3;i++){
		vector<pair<double,int> > data;
		for(int j=0;j<8;j++){
			cin>>n>>a;
			data.push_back(make_pair(a,n));
		}
		sort(data.begin(),data.end());
		for(int j=0;j<2;j++){
			printf("%d %.2f\n",data[j].second,data[j].first);
		}
		for(int j=2;j<4;j++){
			lose.push_back(make_pair(data[j].first,data[j].second));
		}
	}
	sort(lose.begin(),lose.end());
	for(int i=0;i<2;i++){
		printf("%d %.2f\n",lose[i].second,lose[i].first);
	}
}

C++: #include<string>
#include<iostream>
#include<map>
using namespace std;
int main() {
	map<double, int>d;
	for (int i = 0; i < 3; i++) {
		map<double, int>a;
		int b;
		double c;
		for (int j = 0; j < 8; j++) {
			cin >> b >> c;
			a.insert(map<double, int>::value_type(c, b));
		}
		map<double, int>::iterator it = a.begin();
		cout << (*it).second << " " << (*it).first << endl;
		it++;
		cout << (*it).second << " " << (*it).first << endl;
		it++;
		d.insert(map<double, int>::value_type((*it).first, (*it).second));
	}
	map<double, int>::iterator it = d.begin();
	cout << (*it).second << " " << (*it).first << endl;
	it++;
	cout << (*it).second << " " << (*it).first << endl;
	it++; 
}

C++: #include <stdio.h>
#include <map>
#include <string>
#include <algorithm>

using namespace std;

struct smap {
    int number;
    double time;
};typedef struct smap Smap;

//プロトタイプ宣言
bool tfsort (const Smap &a, const Smap &b);

//main関数
int main(){
    int i, number, cnt = 0, idx = 0;
    double time;
    Smap rec[50];
    map<int, double> data;

    //入力
    for(i = 0;i < 24; i++){
        scanf("%d %lf", &number, &time);
        data[number] = time;
    }
    
    
    //map-構造体変換
    for(auto &p: data){
        rec[cnt] = (Smap){p.first, p.second};
        cnt++;
    }
    //3組ごとのソート
    for(i = 0; i <= 24; i += 8){
        sort(rec + i, rec + i + 8, tfsort);
    }
    printf("---------------------\n");
    //上位二組出力
    for(i = 0; i < 3; i++){
        printf("%d %0.2f\n", rec[idx].number, rec[idx].time);
        printf("%d %0.2f\n", rec[idx + 1].number, rec[idx + 1].time);
        rec[idx].time = -1.0;
        rec[idx + 1].time = -1.0;
        idx += 8;
    }
    
    //全てのチームをソート
    sort(rec, rec + 24, tfsort);
    
    //3位以下の上位二人を出力
    for(i = 6; i < 8; i++){
        printf("%d %0.2f\n", rec[i].number, rec[i].time);
    }
    
    return 0;
}

bool tfsort (const Smap &a, const Smap &b){
    if(a.time < b.time) return true;
    return false;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
struct score{
	int n;
	double t;
};
int main(){
	score a[8],o[8],x,b[18];
	int c1 = 0,c2 = 0;
	for(int i = 0;i < 3;++i){
		for(int j = 0;j < 8;++j){
			cin >> x.n >> x.t;
			a[j] = x;
		}
		for(int j = 0;j < 8;++j){
			for(int k = 7;j < k;++k){
				if(a[j].t > a[k].t){
					swap(a[j],a[k]);
				}
			}
		}
		for(int j = 0;j < 8;++j){
			if(j < 2) {
				o[c1++] = a[j];
			}
			else b[c2++] = a[j];
		}
	}
	for(int i = 0;i < 18;++i){
		for(int j = 17;j > i;++j){
			if(b[i].t > b[j].t){
				swap(b[i],b[j]);
			}
		}
	}
	for(int i = 0;i < 2;++i){
		o[c1++] = b[i];
	}
	for(int i = 0;i < 8;++i){
		cout << o[i].n << " " << o[i].t << endl;
	}
	return 0;
}