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


typedef struct{
    int backnum;
    double time;
} runner;

void q_sort(runner data[], int begin, int end);

int main(int argc, const char * argv[])
{
    int a = 0;
    runner data[3][8];
    runner under[6];
    for (int i = 0; i < 3; i++) {
        for (int k = 0; k < 8; k++) {
            cin >> data[i][k].backnum >> data[i][k].time;
        }
    }
    for (int i = 0; i < 3; i++) {
        q_sort(data[i], 0, 7);
    }
    for (int i = 0; i < 3; i++){
        for (int k = 2; k < 4; k++) {
            under[a] = data[i][k];
            a++;
        }
    }
    q_sort(under, 0, 5);
    for (int i = 0; i < 3; i++) {
        for (int k = 0; k < 2; k++) {
            printf("%d %.2f\n", data[i][k].backnum, data[i][k].time);
        }
    }
    for (int i = 0; i < 2; i++) {
        printf("%d %.2f\n", under[i].backnum, under[i].time);
    }
    return 0;
}

void q_sort(runner data[], int begin, int end){
    int i = begin;
    int k = end;
    runner pivot;
    runner temp;
    pivot = data[(begin + end) / 2];
    while (1) {
        while (data[i].time < pivot.time) {
            i++;
        }
        while (pivot.time < data[k].time) {
            k--;
        }
        if (i >= k) {
            break;
        }
        temp = data[i];
        data[i] = data[k];
        data[k] = temp;
        i++;
        k--;
    }
    if (begin < i - 1) {
        q_sort(data, begin, i - 1);
    }
    if (k + 1 < end) {
        q_sort(data, k + 1, end);
    }
}

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

int main()
{
	int n, i;
	string s;
	map<string, int> m, m2;
	map<string, int>::iterator it;
	for (i = 0; i < 8; i++) {
		cin>>n>>s;
		m[s] = n;
		m2[s] = n;
	}
	it = m.begin();
	cout<<(*it).second<<" "<<(*it).first<<endl;
	m2.erase(m2.find((*it).first));
	it++;
	cout<<(*it).second<<" "<<(*it).first<<endl;
	m2.erase(m2.find((*it).first));
	m.clear();
	for (i = 8; i < 16; i++) {
		cin>>n>>s;
		m[s] = n;
		m2[s] = n;
	}
	it = m.begin();
	cout<<(*it).second<<" "<<(*it).first<<endl;
	m2.erase(m2.find((*it).first));
	it++;
	cout<<(*it).second<<" "<<(*it).first<<endl;
	m2.erase(m2.find((*it).first));
	m.clear();
	for (i = 16; i < 24; i++) {
		cin>>n>>s;
		m[s] = n;
		m2[s] = n;
	}
	it = m.begin();
	cout<<(*it).second<<" "<<(*it).first<<endl;
	m2.erase(m2.find((*it).first));
	it++;
	cout<<(*it).second<<" "<<(*it).first<<endl;
	m2.erase(m2.find((*it).first));
	it = m2.begin();
	cout<<(*it).second<<" "<<(*it).first<<endl;
	it++;
	cout<<(*it).second<<" "<<(*it).first<<endl;
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
using namespace std;
struct track{
	int number;
	double time;
};

int main(){
	struct track a[3][8],t,x,y,z;
	for(int i=0;i<3;i++){
		for(int j=0;j<8;j++){
			cin>>a[i][j].number>>a[i][j].time;
		}
	}

	for(int i=0;i<3;i++){
		for(int j=0;j<7;j++){
			for(int k=j+1;k<8;k++){
				if(a[i][j].time>a[i][k].time){
					t = a[i][j];
					a[i][j] = a[i][k];
					a[i][k] = t;
				}
			}
		}
	}
	for(int i=0;i<3;i++){
		for(int j=0;j<2;j++){
			printf("%d %.2lf\n",a[i][j].number,a[i][j].time);
		}
	}
	
	x = a[0][2];
	y = a[1][2];
	z = a[2][2];
	for(int i=0;i<2;i++){
		if(x.time<y.time && x.time<z.time){
			printf("%d %.2lf\n",x.number,x.time);
			x = a[0][3];
		}else if(y.time<x.time && y.time<z.time){
			printf("%d %.2lf\n",y.number,y.time);
			y = a[1][3];
		}else if(z.time<y.time && z.time<x.time){
			printf("%d %.2lf\n",z.number,z.time);
			z = a[2][3];
		}
	}

	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
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);
        for(int i = 2 ; i < v.size() ; i++) th.push_back(v[i]);
    }
    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 <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>

using namespace std;

struct memb{
	int ID;
	double time;
};

memb yosen1[3][8];

memb yosen2[18];

int main(){
	
	for(int i = 0; i < 3; i++){
		for(int j = 0; j < 8; j++){
			cin >> yosen1[i][j].ID >> yosen1[i][j].time;
		}
	}
	
	for(int i = 0; i < 3; i++){
		for(int j = 0; j < 8; j++){
			for(int k = 6; k >= j; k--){
				if(yosen1[i][k].time > yosen1[i][k + 1].time){
					swap(yosen1[i][k], yosen1[i][k + 1]);
				}
			}
		}
	}
	
	for(int i = 0; i < 3; i++){
		for(int j = 0; j < 2; j++){
			cout << yosen1[i][j].ID << " " << yosen1[i][j].time << endl;
		}
	}
	
	for(int i = 0; i < 3; i++){
		for(int j = 2; j < 8; j++){
			yosen2[i * 6 + j - 2] = yosen1[i][j];
		}
	}
	
	for(int j = 0; j < 18; j++){
		for(int k = 16; k >= j; k--){
			if(yosen2[k].time > yosen2[k + 1].time){
				swap(yosen2[k], yosen2[k + 1]);
			}
		}
	}
	
	for(int j = 0; j < 2; j++){
		cout << yosen2[j].ID << " " << yosen2[j].time << endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
typedef pair<double,int>pii;
int main(){
    vector<pii>rize;
    vector<vector<pii>>gotiusa(3,vector<pii>());
    for(int i=1; i<=24;i++){
        pii tiya; cin>>tiya.second>>tiya.first;
        if(i<=8){gotiusa[0].push_back(pii(tiya));}
        else if(i<=16){gotiusa[1].push_back(tiya);}
        else gotiusa[2].push_back(tiya);
    }
    for(int i=0; i<3;i++)sort(gotiusa[i].begin(),gotiusa[i].end());
    for (int i=0;i<3;i++) {
        for(int j=0; j<2;j++)cout<<gotiusa[i][j].second<<" "<<gotiusa[i][j].first<<endl;
        for(int j=2; j<gotiusa[i].size();j++)rize.push_back(gotiusa[i][j]);
    }
    sort(rize.begin(),rize.end());
    for(int i=0;i<2;i++)cout<<rize[i].second<<" "<<rize[i].first<<endl;
}