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++: // 2011/01/04 Tazoe

#include <iostream>
#include <iomanip>
using namespace std;

struct sensyu
{
	int bangou;
	double time200;
};

void sort_sensyu(struct sensyu sem[24], int nb, int ne)
{
	for(int i=nb; i<=ne-1; i++)
		for(int j=i+1; j<=ne; j++)
			if(sem[i].time200>sem[j].time200){
				struct sensyu tmp = sem[i];
				sem[i] = sem[j];
				sem[j] = tmp;
			}
}

int main()
{
	struct sensyu sem[24];
	for(int i=0; i<24; i++)
		cin >> sem[i].bangou >> sem[i].time200;

	struct sensyu fin[8];

	sort_sensyu(sem, 0, 7);
	fin[0] = sem[0];
	fin[1] = sem[1];

	sort_sensyu(sem, 8, 15);
	fin[2] = sem[8];
	fin[3] = sem[9];

	sort_sensyu(sem, 16, 23);
	fin[4] = sem[16];
	fin[5] = sem[17];

	sem[4] = sem[10];
	sem[5] = sem[11];
	sem[6] = sem[18];
	sem[7] = sem[19];
	sort_sensyu(sem, 2, 7);
	fin[6] = sem[2];
	fin[7] = sem[3];

	for(int i=0; i<8; i++)
		cout << fin[i].bangou << ' ' << showpoint << setprecision(4) << fin[i].time200 << endl;

	return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>

#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define vi vector<int>
#define VS vector<string>
#define all(x) x.begin(),x.end()
#define mp make_pair
#define pb push_back

using namespace std;

vector<pair<int, float> > other;

bool pairCompare(const std::pair<int, int>& firstElem, const std::pair<int, int>& secondElem) {
    return firstElem.second > secondElem.second;
}

int main(){
    for(int j=0; j < 3; j++){
        vector<pair<int, float> > timer;
        for(int i=0; i < 8; i++){
            int n; float t;
            cin >> n >> t;
            timer.push_back(mp(n, t));
        }
        sort(timer.begin(), timer.end(), pairCompare);
        printf("%d %.2f\n",timer[timer.size()-1].first, timer[timer.size()-1].second);
        printf("%d %.2f\n",timer[timer.size()-2].first, timer[timer.size()-2].second);

        timer.pop_back(); timer.pop_back();
        for(int i=0; i < timer.size(); i++){
            other.push_back(timer[i]);
        }
        timer.clear();
    }
    sort(other.begin(), other.end(), pairCompare);
    printf("%d %.2f\n",other[other.size()-1].first, other[other.size()-1].second);
    printf("%d %.2f\n",other[other.size()-2].first, other[other.size()-2].second);

}

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 < 25; 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 <string>
#include <map>
#include <vector>
#include <algorithm>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int main()
{
	vector<pair<double,int> > v,v1,v2,temp;
	int a;
	double b;
	
	rep(i,8)
	{
		cin >> a >> b;
		v.push_back(make_pair(b,a));
	}

	rep(i,8)
	{
		cin >> a >> b;
		v1.push_back(make_pair(b,a));
	}

	rep(i,8)
	{
		cin >> a >> b;
		v2.push_back(make_pair(b,a));
	}

	sort(v.begin(),v.end());
	sort(v1.begin(),v1.end());
	sort(v2.begin(),v2.end());
	
	cout << fixed;
	cout.precision(2);

	REP(i,2,4)
	{
		temp.push_back(v[i]);
		temp.push_back(v1[i]);
		temp.push_back(v2[i]);
	}

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

	rep(i,2) cout << v[i].second << " " << v[i].first << endl;
	rep(i,2) cout << v1[i].second << " " << v1[i].first << endl;
	rep(i,2) cout << v2[i].second << "  "<< v2[i].first << endl;
	rep(i,2) cout << temp[i].second << " " <<temp[i].first << endl;
	return 0;
}

C++: //42
#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<string>

using namespace std;

int main(){
  pair<string,int> t[3][8];
  vector<pair<string,int> > v;
  for(int i=0;i<3;i++){
    for(int j=0;j<8;j++){
      cin>>t[i][j].second>>t[i][j].first;
    }
    sort(t[i],t[i]+8);
    for(int j=0;j<2;j++){
      cout<<t[i][j].second<<' '<<t[i][j].first<<endl;
    }
    v.insert(v.end(),t[i]+2,t[i]+8);
  }
  sort(v.begin(),v.end());
  for(int i=0;i<2;i++){
    cout<<v[i].second<<' '<<v[i].first<<endl;
  }
  return 0;
}