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 <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);

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 < 17; i += 8){
        sort(rec + i, rec + i + 8, tfsort);
    }
    //上位二組出力
    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 <bits/stdc++.h>

using namespace std;

typedef pair<double, int> p;
 
int main()
{
    vector<p> v, th;
    int n = 3, num;
    double data;
    
    while (n--) {
        v.clear();
        for (int i = 0; i < 8; i++) {
            cin >> num >> data;
            v.push_back(p(data, num));
        }
        sort(v.begin(), v.end());
        printf("%d %.2f\n", v[0].second, v[0].first);
        printf("%d %.2f\n", v[1].second, v[1].first);
        th.push_back(v[2]);
    }
    sort(th.begin(), th.end());
    printf("%d %.2f\n", th[0].second, th[0].first);
    printf("%d %.2f\n", th[1].second, th[1].first);
    return 0;
}

C++: #include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cctype>
#include<complex>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<functional>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
using namespace std;
const int dx[] = {1,0,-1,0},dy[] = {0,1,0,-1};
#define INF 1e+8
#define rep(i,j) for(int i = 0; i < (j); i++)
#define reps(i,j,k) for(int i = j; i < k; i++)
typedef long long ll;
typedef unsigned long long ull;
int main(){
    typedef pair<double,int> P;
    priority_queue < P, vector< P >, greater< P > > hoge;
    vector < P > ans; 
    P fuga;
    int cnt = 0;
    rep(i,3){
        P p[10];
        rep(j,8){
            cin >> p[j].second >> p[j].first;
        }
        sort(p,p+8); 
        ans.push_back(p[0]);
        ans.push_back(p[1]);   
        hoge.push(p[2]);
        hoge.push(p[3]);
    }
    rep(i,6){
        cout << ans[i].second << " " << ans[i].first << endl;
    }
    fuga = hoge.top();hoge.pop();
    cout << fuga.second << " "<< fuga.first << endl; 
    fuga = hoge.top();hoge.pop();
    cout << fuga.second << " "<< fuga.first << endl;
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef pair<double, int> P;
vector<P> v[4];

int main() {
	for (int i = 0; i != 24; ++i) {
		int n;
		double t;
		cin >> n >> t;
		v[i / 8].push_back(P(t, n));
	}
	for (int i = 0; i != 3; ++i)
		sort(v[i].begin(), v[i].end());

	for (int i = 0; i != 3; ++i)
		for (int j = 2; j != 8; ++j)
			v[3].push_back(v[i][j]);

	sort(v[3].begin(), v[3].end());

	for (int i = 0; i != 4; ++i)
		for (int j = 0; j != 2; ++j)
			cout << v[i][j].second << ' ' << fixed << setprecision(2)
					<< v[i][j].first << endl;

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  pair<double,int> d[3][8],dd[18];
  for(int i=0;i<3;i++){
    for(int j=0;j<8;j++)cin>>d[i][j].second>>d[i][j].first;
    sort(d[i],d[i]+8);
    for(int j=2;j<8;j++)dd[i*6+j-2]=d[i][j];
  }
  sort(dd,dd+18);
  for(int i=0;i<3;i++)
    for(int j=0;j<2;j++)cout<<d[i][j].second<<' '<<d[i][j].first<<endl;
  cout<<dd[0].second<<' '<<dd[0].first<<endl;
  cout<<dd[1].second<<' '<<dd[1].first<<endl;
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define rep(i,a) for(int i = 0; i < (a); i++)
#define reps(i, a, b) for(int i = (a); i < (b); i++)
#define INF 1e9
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef pair<double, int> pdi;
void output(pdi d) {
	printf("%d %.2lf\n", d.second, d.first);
}
int main() {
	vector<vector<pdi>> input = vector<vector<pdi>>(3, vector<pdi>(8, make_pair(0,0)));
	vector<pdi> h;
	rep(i, 3) {
		rep(j, 8) cin >> input[i][j].second >> input[i][j].first;
		sort(input[i].begin(), input[i].end(), greater<pdi>());
		rep(j, 2) {
			output(input[i].back());
			input[i].pop_back();
		}
		rep(j, input[i].size()) h.push_back(input[i][j]);
	}
	sort(h.begin(), h.end(), greater<pdi>());
	rep(i, 2) {
		//output(h[h.size() - 1 - i]);
		output(h.back());
		h.pop_back();
	}
	
	return 0;
}