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 <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, double>& firstElem, const std::pair<int, double>& secondElem) {
    return firstElem.second > secondElem.second;
}

int main(){
    for(int j=0; j < 3; j++){
        vector<pair<int, double> > timer;
        for(int i=0; i < 8; i++){
            int n; double 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<utility>
#include<algorithm>
#include<limits>
using namespace std;
int main()
{
	const int N1 = 3, N2=8;
	int i,j;
	pair<double,int>a[N2], w1,w2;
	w1.first = w2.first = numeric_limits<double>::max();
	for(i=0;i<N1;++i)
	{
		for(j=0;j<N2;++j)
		{
			scanf("%d %lf",&a[j].second, &a[j].first);
		}
		sort(a, a+N2);
		for(j=0;j<2;++j)
			printf("%d %.2f\n",a[j].second, a[j].first);
		for(j=2;j<4;++j)
			if(w1.first > a[j].first)
			{
				w2=w1;
				w1=a[j];
			}
	}
	printf("%d %.2f\n"
		"%d %.2f\n", w1.second, w1.first, w2.second, w2.first);
	return 0;
}

C++: #include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstdio>
#define EPS 1e-10
#define F first
#define S second
using namespace std;
typedef pair<int,double> P;

bool cmp(const P &p,const P &q){
  if(!(fabs(p.S-q.S)<=EPS))return p.S < q.S;
  return p.F > q.F;
}


int main(){
  P info[30];
  bool used[30];
  for(int i=0;i<24;i++){cin >> info[i].F >> info[i].S;used[i] = false;}
  sort(info,info+7,cmp);
  printf("%d %.2lf\n",info[0].F,info[0].S);used[info[1].F] = true;
  printf("%d %.2lf\n",info[1].F,info[1].S);used[info[0].F] = true;
  sort(info+8,info+15,cmp);
  printf("%d %.2lf\n",info[8].F,info[8].S); used[info[8].F] = true;
  printf("%d %.2lf\n",info[9].F,info[9].S); used[info[9].F] = true;
  sort(info+16,info+23,cmp);
  printf("%d %.2lf\n",info[16].F,info[16].S); used[info[16].F] = true;
  printf("%d %.2lf\n",info[17].F,info[17].S); used[info[17].F] = true;
  sort(info,info+23,cmp);
  int cnt = 0;
  for(int i=0;i<24;i++){
    if(!used[info[i].F]){
      cnt++;
      printf("%d %.2lf\n",info[i].F,info[i].S);
    }
    if(cnt == 2)break;
  }
}

C++: #include <bits/stdc++.h>
using namespace std;
  
// #define int long long
#define pb push_back
#define print(Target) cout << Target << '\n'

#define REP(i, n) for (int i = 0; i < (n); i++)
#define REPS(i, a, n) for (int i = (a); i < (n); i++)

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;

bool is_uruu(int y) {return (y % 4 == 0 && (y % 100 != 0 || y % 400 == 0));}

struct INFO{
  int num;
  double t;
};

bool cmp(INFO lhs, INFO rhs)
{
  return (lhs.t < rhs.t);
}

signed main()
{
  ios::sync_with_stdio(false);
  vector<INFO> lose;

  REP(i, 3){
    vector<INFO> info;
    REP(j, 8){
      int num; double t;
      cin >> num >> t;
      info.pb((INFO){num, t});
    }
    sort(info.begin(), info.end(), cmp);
    REP(j, 2){
      cout << info[j].num << " " << info[j].t << '\n';
    }
    REPS(j, 2, 8){
      lose.pb(info[j]);
    }
  }
  sort(lose.begin(), lose.end(), cmp);
  REP(i, 2){
    cout << lose[i].num << " " << lose[i].t << '\n';
  }

  return (0);
}

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

pair<double, int> a[8], b[6], c[8];

int main()
{
    for (int j = 0; j < 3; j++) {
        for (int i = 0; i < 8; i++)
            cin >> a[i].second >> a[i].first;

        sort(a, a + 8);

        for (int i = 0; i < 2; i++) {
            c[j * 2 + i] = a[i]; 
            b[j * 2 + i] = a[i + 2];
        }
    }

    sort(b, b + 6);

    c[6] = b[0];
    c[7] = b[1];

    for (int i = 0; i < 8; i++)
        cout << c[i].second << " "
        << setiosflags(ios::fixed | ios::showpoint) << setprecision(2)
        << c[i].first << endl;

    return 0;
}