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<string>
#include<iomanip>
using namespace std;
double a[8],b[6];
int an[8],bn[6];
int main(){
	for(int i=0;i<8;i++)
		cin>>an[i]>>a[i];
	for(int i=0;i<7;i++){
		for(int j=7;j>i;j--){
			if(a[j]<a[j-1]){
				double tmp=a[j];
				a[j]=a[j-1];
				a[j-1]=tmp;
				tmp=an[j];
				an[j]=an[j-1];
				an[j-1]=tmp;
			}
		}
	}
	cout<<an[0]<<" "<<fixed<<setprecision(2)<<a[0]<<endl;
	cout<<an[1]<<" "<<fixed<<setprecision(2)<<a[1]<<endl;
	b[0]=a[2],bn[0]=an[2],b[1]=a[3],bn[1]=an[3];
	for(int i=0;i<8;i++)
		cin>>an[i]>>a[i];
	for(int i=0;i<7;i++){
		for(int j=7;j>i;j--){
			if(a[j]<a[j-1]){
				double tmp=a[j];
				a[j]=a[j-1];
				a[j-1]=tmp;
				tmp=an[j];
				an[j]=an[j-1];
				an[j-1]=tmp;
			}
		}
	}
	cout<<an[0]<<" "<<fixed<<setprecision(2)<<a[0]<<endl;
	cout<<an[1]<<" "<<fixed<<setprecision(2)<<a[1]<<endl;
	b[2]=a[2],bn[2]=an[2],b[3]=a[3],bn[3]=an[3];
	for(int i=0;i<8;i++)
		cin>>an[i]>>a[i];
	for(int i=0;i<7;i++){
		for(int j=7;j>i;j--){
			if(a[j]<a[j-1]){
				double tmp=a[j];
				a[j]=a[j-1];
				a[j-1]=tmp;
				tmp=an[j];
				an[j]=an[j-1];
				an[j-1]=tmp;
			}
		}
	}
	cout<<an[0]<<" "<<fixed<<setprecision(2)<<a[0]<<endl;
	cout<<an[1]<<" "<<fixed<<setprecision(2)<<a[1]<<endl;
	b[4]=a[2],bn[4]=an[2],b[5]=a[3],bn[5]=an[3];
	for(int i=0;i<5;i++){
		for(int j=5;j>i;j--){
			if(b[j]<b[j-1]){
				double tmp=b[j];
				b[j]=b[j-1];
				b[j-1]=tmp;
				tmp=bn[j];
				bn[j]=bn[j-1];
				bn[j-1]=tmp;
			}
		}
	}
	cout<<bn[0]<<" "<<fixed<<setprecision(2)<<b[0]<<endl;
	cout<<bn[1]<<" "<<fixed<<setprecision(2)<<b[1]<<endl;
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
struct athlete{int num; double time;};

bool tsort(const athlete& l, const athlete& r){
	return l.time < r.time;
}

int main(){
	athlete a[3][8], f[3];
	for(int i=0;i<3;i++){
		for(int j=0;j<8;j++){
			int num;
			double time;
			std::cin >> num >> time;
			a[i][j].num = num, a[i][j].time = time;
		}
		std::sort(a[i],a[i]+8,tsort);

		//3ÊðÅIIlÉñ·D
		f[i] = a[i][2];
	}

	//egÌ1ÊÆ2Êð\¦
	for(int i=0;i<3;i++){
		printf("%d %lf\n",a[i][0].num,a[i][0].time);
		printf("%d %lf\n",a[i][1].num,a[i][1].time);
	}

	//egÌ3ÊæèãÊ2lðÖD
	std::sort(f,f+3,tsort);
	printf("%d %lf\n",f[0].num,f[0].time);
	printf("%d %lf\n",f[1].num,f[1].time);
}

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

int main(){
	double t[100] = {};
	vector<double> ans;
	vector<double> p;

	for(int i=0 ; i<3 ; ++i ){
		vector<double> vc;
		for(int j=0 ; j<8 ; ++j ){
			int No;
			double time;
			scanf("%d %lf", &No , &time );
			t[No] = time;
			vc.push_back(time);
			p.push_back(time);
		}
		sort( vc.begin() , vc.end() );
		ans.push_back( vc[0] );
		ans.push_back( vc[1] );
	}
	vector<double> foo;
	for(int i=0 ; i<p.size() ; ++i){
		bool flag = true;
		for(int j=0 ; j<(int)ans.size() ; ++j )
			if( p[i] == ans[j] )
				flag = false;
		
		if( flag )
			foo.push_back( p[i] );
	}
	sort( foo.begin() , foo.end() );
	ans.push_back( foo[0] );
	ans.push_back( foo[1] );
	
	for(int i=0 ; i<(int)ans.size() ; ++i ){
		for(int j=0 ; j<25 ; ++j ){
			if( t[j] == ans[i] )
				printf("%d %.2f\n", j , ans[i] );
		}
	}
}

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

struct man{
	int no;
	double time;
};

man p[24];
man hk[6];

void solve(){
	man tmp;
	for(int i=0; i<7; i++){
		if(p[i].time > p[i+1].time){
			tmp = p[i];
			p[i] = p[i+1];
			p[i+1] = tmp;
			i=-1;
		}
	}
	for(int i=8; i<15; i++){
		if(p[i].time > p[i+1].time){
			tmp = p[i];
			p[i] = p[i+1];
			p[i+1] = tmp;
			i=7;
		}
	}
	for(int i=16; i<23; i++){
		if(p[i].time > p[i+1].time){
			tmp = p[i];
			p[i] = p[i+1];
			p[i+1] = tmp;
			i=15;
		}
	}
	hk[0] = p[3];
	hk[1] = p[4];
	hk[2] = p[10];
	hk[3] = p[11];
	hk[4] = p[18];
	hk[5] = p[19];
	for(int i=0; i<5; i++){
		if(hk[i].time > hk[i+1].time){
			tmp = hk[i];
			hk[i] = hk[i+1];
			hk[i+1] = tmp;
			i=-1;
		}
	}
}

int main(){
	for(int i=0; i<24; i++)
		cin >> p[i].no >> p[i].time;
	solve();
	cout << p[0].no << ' ' << setprecision(2) << fixed << p[0].time << endl;
	cout << p[1].no << ' ' << setprecision(2) << fixed << p[1].time << endl;
	cout << p[8].no << ' ' << setprecision(2) << fixed << p[8].time << endl;
	cout << p[9].no << ' ' << setprecision(2) << fixed << p[9].time << endl;
	cout << p[16].no << ' ' << setprecision(2) << fixed << p[16].time << endl;
	cout << p[17].no << ' ' << setprecision(2) << fixed << p[17].time << endl;
	cout << hk[0].no << ' ' << setprecision(2) << fixed << hk[0].time << endl;
	cout << hk[1].no << ' ' << setprecision(2) << fixed << hk[1].time << endl;
}

C++: #include <stdio.h>
#include <algorithm>
using namespace std;
pair<double, int> p1[8], p2[8], p3[8], p4[24];
int main() {
	for(int i = 0; i < 8; i++) scanf("%d %lf", &p1[i].second, &p1[i].first), p4[i] = p1[i]; sort(p1, p1 + 8);
	for(int i = 0; i < 8; i++) scanf("%d %lf", &p2[i].second, &p2[i].first), p4[i + 8] = p1[i]; sort(p2, p2 + 8);
	for(int i = 0; i < 8; i++) scanf("%d %lf", &p3[i].second, &p3[i].first), p4[i + 16] = p1[i]; sort(p3, p3 + 8);
	printf("%d %lf\n%d %lf\n", p1[0].second, p1[0].first, p1[1].second, p1[1].first);
	printf("%d %lf\n%d %lf\n", p2[0].second, p2[0].first, p2[1].second, p2[1].first);
	printf("%d %lf\n%d %lf\n", p3[0].second, p3[0].first, p3[1].second, p3[1].first);
	sort(p4, p4 + 24);
	for(int i = 0, c = 0; c < 2; i++) {
		int s = p4[i].second; bool flag = true;
		flag = flag && (s != p1[0].second && s != p2[0].second && s != p3[0].second);
		flag = flag && (s != p1[1].second && s != p2[1].second && s != p3[1].second);
		if(flag) printf("%d %lf\n", p4[i].second, p4[i].first), c++;
	}
	return 0;
}