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 <vector>
#include <algorithm>
using namespace std;

int main() {
    vector<pair<double,int>> t;
    for (int i=0; i<3; ++i) {
        vector<pair<double,int>> tt(8);
        for (int j=0; j<8; ++j) {
            cin >> tt[j].second >> tt[j].first;
        }
        sort(tt.begin(), tt.end());
        cout.precision(2);
        cout << fixed;
        cout << tt[0].second << " " << tt[0].first << endl;
        cout << tt[1].second << " " << tt[1].first << endl;
        for (int j=2; j<8; ++j) {
            t.push_back(tt[j]);
        }
    }
    sort(t.begin(), t.end());
    cout.precision(2);
    cout << fixed;
    cout << t[0].second << " " << t[0].first << endl;
    cout << t[1].second << " " << t[1].first << endl;
    return 0;
}

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

int main(){
  int i=0,j,x;
  float f;
  vector<pair<float,int> >v,w;
  for(;i<3;i++){
    for(j=0;j<8;j++)
      scanf("%d%f",&x,&f),v.push_back(make_pair(f,x));
    sort(v.begin(),v.end());
    printf("%d %f\n%d %.2f\n",v[0].second,v[0].first,v[1].second,v[1].first);
    w.push_back(make_pair(v[2].first,v[2].second));
    w.push_back(make_pair(v[3].first,v[3].second));
    v.clear();
  }
  sort(w.begin(),w.end());
  printf("%d %f\n%d %.2f\n",w[0].second,w[0].first,w[1].second,w[1].first);
}

C++: #include <iostream>
#include <queue>

using namespace std;
typedef pair<double, int> P;

void solve()
{
	priority_queue<P, vector<P>, greater<P>> PQue[3];
	for(int a = 0; a < 3; ++a)
	{
		for(int i = 0; i < 8; ++i)
		{
			P p;
			cin >> p.second >> p.first;
			PQue[a].push(p);
		}
	}
	for(int a = 0; a < 3; ++a)
	{
		for(int i = 0; i < 2; ++i)
		{
			printf("%d %.2f\n", PQue[a].top().second, PQue[a].top().first);
			PQue[a].pop();
		}
	}
	for(int a = 1; a < 3; ++a)
	{
		for(int i = 0; i < 2; ++i)
		{
			PQue[0].push(PQue[a].top());
			PQue[a].pop();
		}
	}
	for(int i = 0; i < 2; ++i)
	{
		printf("%d %.2f\n", PQue[0].top().second, PQue[0].top().first);
		PQue[0].pop();
	}

}

int main()
{
	solve();
	return(0);
}

C++: #include <iostream>
#include <cstdio>
#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];
				++c1;
			}
			else {
				b[c2] = a[j];
				++c2;
			}
		}
	}
	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];
		++c1;
	}
	for(int i = 0;i < 8;++i){
		printf("%d %f\n",o[i].n,o[i].t);
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>

struct Player {
	int id;
	float time;
	Player() {}
	Player(int id, float time) : id(id), time(time) {}
};
bool operator < (const Player& p1, const Player& p2) { return p1.time < p2.time; }

int main()
{
	Player reserve[6];
	for (int group=0; group<3; group++) {
		Player players[8];
		for (int i=0; i<8; i++) {
			int id;
			float time;
			std::cin >> id >> time;
			players[i] = Player(id, time);
		}
		std::sort(players, players + 8);
		std::cout << players[0].id << " " << players[0].time << std::endl;
		std::cout << players[1].id << " " << players[1].time << std::endl;
		reserve[2*group] = players[2];
		reserve[2*group + 1] = players[3];
	}
	std::sort(reserve, reserve + 6);
	std::cout << reserve[0].id << " " << reserve[0].time << std::endl;
	std::cout << reserve[1].id << " " << reserve[1].time << std::endl;
	
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<list>
#include<stack>
#include<queue>
#include<cctype>
#include<iomanip>
#include<functional>
#include<numeric>
#include<map>
#include<set>
#include<complex>
#define EPS 1e-10
using namespace std;
typedef long long llong;
bool f(pair<int, double>a, pair<int, double>b) {
	return a.second < b.second;
}
int main() {
	vector<pair<int, double> >v(24);
	for (int i = 0; i < 24; i++) {
		cin >> v[i].first >> v[i].second;
	}
	//cout << endl << endl;
	sort(v.begin(), v.begin() + 8, f);
	cout << v[0].first << " " << v[0].second << endl;
	cout << v[1].first << " " << v[0].second << endl;

	sort(v.begin() + 8, v.begin() + 8 + 8, f);
	cout << v[8].first << " " << v[8].second << endl;
	cout << v[9].first << " " << v[9].second << endl;

	sort(v.begin() + 8 + 8, v.end(), f);
	cout << v[16].first << " " << v[16].second << endl;
	cout << v[17].first << " " << v[17].second << endl;

	v.erase(v.begin() + 8 + 8, v.begin() + 8 + 8 + 2);
	v.erase(v.begin() + 8, v.begin() + 8 + 2);
	v.erase(v.begin(), v.begin() + 2);

	sort(v.begin(), v.end(), f);
	cout << v[0].first << " " << v[0].second << endl;
	cout << v[1].first << " " << v[0].second << endl;

	return 0;
}

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

int main(){
  int i=0,j,x;
  float f;
  vector<pair<float,int> >v,w;
  for(;i<3;i++){
    for(j=0;j<8;j++)
      scanf("%d%f",&x,&f),v.push_back(make_pair(f,x));
    sort(v.begin(),v.end());
    printf("%d %.2f\n%d %.2f\n",v[0].second,v[0].first,v[1].second,v[1].first);
    w.push_back(make_pair(v[2].first,v[2].second));
    w.push_back(make_pair(v[3].first,v[3].second));
    v.clear();
  }
  sort(w.begin(),w.end());
  printf("%d %.2f\n%d %.2f\n",w[0].second,w[0].first,w[1].second,w[1].first);
}