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<cstdio>
#include<vector>
#include<algorithm>

using namespace std;

int main()
{
	vector< pair<double,int> > v[3];

	for(int i=0;i<24;i++){
		int id;
		double tm;
		scanf("%d%lf",&id,&tm);
		v[i/8].push_back(make_pair(tm,id));
	}

	vector< pair<double,int> >	rem;
	for(int i=0;i<3;i++){
		sort(v[i].begin(),v[i].end());
		printf("%d %.2f\n",v[i][0].second,v[i][0].first);
		printf("%d %.2f\n",v[i][1].second,v[i][1].first);
		v[i].erase(v[i].begin());
		v[i].erase(v[i].begin());
		rem.insert(rem.begin(),v[i].begin(),v[i].end());
	}

	sort(rem.begin(),rem.end());
	printf("%d %.2f\n",rem[0].second,rem[0].first);
	printf("%d %.2f\n",rem[1].second,rem[1].first);

	return 0;
}

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


struct P{
  P(int a,double b){
    num=a;
    time=b;
  }
  int num;
  double time;
};

bool operator<(P a,P b){
  if(a.time!=b.time){
    return a.time<b.time;
  }else{
    return a.num<b.num;
  }
}

vector<P> g[3];
vector<P> all;
void solve(){
  for(int i=0;i<3;i++){
    for(int j=0;j<8;j++){
      int t1;
      double t2;
      cin>>t1>>t2;
      g[i].push_back(P(t1,t2));
    }
    sort(g[i].begin(),g[i].end());
  }
  for(int i=2;i<8;i++){
    for(int j=0;j<3;j++){
      all.push_back(g[j][i]);
    }
  }
  sort(all.begin(),all.end());

  for(int i=0;i<3;i++){
    for(int j=0;j<2;j++){
      cout<<g[i][j].num<<" "<<fixed<<setprecision(2)<<g[i][j].time<<endl;
    }
  }
  cout<<all[0].num<<" "<<fixed<<setprecision(2)<<all[0].time<<endl;
  cout<<all[1].num<<" "<<fixed<<setprecision(2)<<all[1].time<<endl;
}

int main(){
  solve();
}

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

int main ()
{
    vector<vector<pair<double,int> > > v(3, vector<pair<double,int> >(8));
    vector<pair<double,int> > tmp;
    for (auto &t : v) for (auto &i : t) cin >> i.second >> i.first;
    for (int i = 0; i < 3; i++)
        sort(v[i].begin(), v[i].end());

    for (int i = 0; i < 3; i++) {
        cout << v[i][0].second << " " << v[i][0].first << endl;
        cout << v[i][1].second << " " << v[i][1].first << endl;
        tmp.push_back(v[i][2]);
        tmp.push_back(v[i][3]);
    }

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

    for (int i = 0; i < 2; i++)
        cout << tmp[i].second << " " << tmp[i].first << endl;

    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
struct athlete{int num; double time;};

bool tsort(const athlete& l, const athlete& r){
	return l.time < r.time;
}

int main(){
	athlete a[3][8], f[3];
	for(int i=0;i<3;i++){
		for(int j=0;j<8;j++){
			int num;
			double time;
			std::cin >> num >> time;
			a[i][j].num = num, a[i][j].time = time;
		}
		std::sort(a[i],a[i]+8,tsort);

		//3ÊðÅIIlÉñ·D
		f[i] = a[i][2];
	}

	//egÌ1ÊÆ2Êð\¦
	for(int i=0;i<3;i++){
		printf("%d %.2lf\n",a[i][0].num,a[i][0].time);
		printf("%d %.2lf\n",a[i][1].num,a[i][1].time);
	}

	//egÌ3ÊæèãÊ2lðÖD
	std::sort(f,f+3,tsort);
	printf("%d %.2lf\n",f[0].num,f[0].time);
	printf("%d %.2lf\n",f[1].num,f[1].time);
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
	int num[24];
	double time[24];
	for(int i=0;i<24;i++)cin>>num[i]>>time[i];
	int thr[3];
	double ti[3];
	for(int i=0;i<3;i++){
		for(int j=0,kawa;j<3;j++){
			kawa=0;
			for(int k=8*i;k<(i+1)*8;k++)if(time[k]<time[kawa])kawa=k;
			if(j==2){
				thr[i]=num[kawa];
				ti[i]=time[kawa];
			}
			else {
				cout<<num[kawa]<<" "<<time[kawa]<<endl;
				time[kawa]=10000;
			}
		}
	}
	for(int i=0,kawa;i<2;i++){
		kawa=0;
		for(int j=0;j<3;j++)if(ti[kawa]>ti[j])kawa=j;
		cout<<thr[kawa]<<" "<<ti[kawa]<<endl;
		ti[kawa]=10000;
	}
	return 0;
}

C++: #include<stdio.h>
struct runnner
{
	int bangou;
	float taimu;
};

float swap(float a)
{
	int b;
	a=a*100+0.5;
	b=(int)a;
	a=(float)b;
	return a;
}

int main()
{
	struct runnner r[24],ll;
	int i,j;
	for(i=0;i<24;i++)
	{
		scanf("%d",&r[i].bangou);
		scanf("%f",&r[i].taimu);
	}
	for(i=0;i<7;i++)
	{
		for(j=i+1;j<8;j++)
		{
			if(r[i].taimu>r[j].taimu)
			{
				ll=r[i];
				r[i]=r[j];
				r[j]=ll;
			}
		}
	}
	for(i=8;i<15;i++)
	{
		for(j=i+1;j<16;j++)
		{
			if(r[i].taimu>r[j].taimu)
			{
				ll=r[i];
				r[i]=r[j];
				r[j]=ll;
			}
		}
	}
	for(i=16;i<23;i++)
	{
		for(j=i+1;j<24;j++)
		{
			if(r[i].taimu>r[j].taimu)
			{
				ll=r[i];
				r[i]=r[j];
				r[j]=ll;
			}
		}
	}
	r[4]=r[10];
	r[5]=r[11];
	r[6]=r[18];
	r[7]=r[19];
	for(i=2;i<4;i++)
	{
		for(j=i+1;j<8;j++)
		{
			if(r[i].taimu>r[j].taimu)
			{
				ll=r[i];
				r[i]=r[j];
				r[j]=ll;
			}
		}
	}
	printf("%d %4.2f\n",r[0].bangou,r[0].taimu);
	printf("%d %4.2f\n",r[1].bangou,r[1].taimu);
	printf("%d %4.2f\n",r[8].bangou,r[8].taimu);
	printf("%d %4.2f\n",r[9].bangou,r[9].taimu);
	printf("%d %4.2f\n",r[16].bangou,r[16].taimu);
	printf("%d %4.2f\n",r[17].bangou,r[17].taimu);
	printf("%d %4.2f\n",r[2].bangou,r[2].taimu);
	printf("%d %4.2f\n",r[3].bangou,r[3].taimu);
}

C++: #include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>
#include <complex>


typedef long long ll;
const double Eps = 1e-6;

using namespace std;

int main()
{
	pair<double ,int> runners[24];
	for (int i = 0; i < 24; ++i)
	{
		int a;
		double b;
		scanf("%d %lf", &a ,&b);
		runners[i] = make_pair(b, a);
	}
	for (int i = 0; i < 3; ++i)
	{
		sort(runners+i*8, runners+8+i*8);
		printf("%d %.2f\n", runners[0 + i*8].second, runners[0 + i*8]);
		printf("%d %.2f\n", runners[1 + i*8].second, runners[1 + i*8]);
		runners[0 + i*8].first = runners[1 + i*8].first = 1e10;
	}
	sort(runners, runners+24);
	printf("%d %.2f\n", runners[0].second, runners[0].first);
	printf("%d %.2f\n", runners[1].second, runners[1].first);

	return 0;
}