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;

class data{
public:
  int number;
  double time;
  bool operator < (const data &s)const{
    return time<s.time;
  }
};

int main(){
  data input[3][8];
  data ans[8];
  data in[18];
  for(int i=0;i<3;i++){
    for(int j=0;j<8;j++){
      cin >> input[i][j].number >> input[i][j].time;
    }
  }

  for(int i=0;i<3;i++){
    sort(input[i], input[i]+8);
  }

  ans[0]=input[0][0];
  ans[1]=input[0][1];
  ans[2]=input[1][0];
  ans[3]=input[1][1];
  ans[4]=input[2][0];
  ans[5]=input[2][1];
  int k=0;
  for(int i=0;i<3;i++){
    for(int j=2;j<8;j++){
      in[k]=input[i][j];
      k++;
    }
  }

  sort(in, in+18);

  ans[6]=in[0];
  ans[7]=in[1];

  for(int i=0;i<8;i++){
    printf("%d %.2f\n", ans[i].number, ans[i].time);
  }

  return 0;
}

C++: #include<iostream>
#include<string>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<algorithm>
#include<complex>
#include<cstdio>
using namespace std ;
typedef vector<int> vi ;
typedef vector<vi> vvi ;
typedef vector<string> vs ;
typedef pair<int, int> pii; 
typedef long long ll ;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()

int main(void){
  vi used;
  vector<vector <double> > anum(24,vector<double>(2) );

  vector<vector <double> > fnum(8,vector<double>(2) );
  vector<vector <double> > snum(8,vector<double>(2) );
  vector<vector <double> > tnum(8,vector<double>(2) );
  
  
  rep(i,8){
    cin>>fnum[i][1]>>fnum[i][0];
    anum[i][0]=fnum[i][0];
    anum[i][1]=fnum[i][1];
  }

  
  rep(i,8){
    cin>>snum[i][1]>>snum[i][0];
    anum[i+8][0]=snum[i][0];
    anum[i+8][1]=snum[i][1];
  }
  
  rep(i,8){
    cin>>tnum[i][1]>>tnum[i][0];
    anum[i+16][0]=tnum[i][0];
    anum[i+16][1]=tnum[i][1];
  }
  /*
  rep(i,24){
    cout<<anum[i][0]<<" "<<anum[i][1]<<endl;
  }
  */
  sort(all(fnum));
  sort(all(snum));
  sort(all(tnum));
  sort(all(anum));
  rep(i,2){cout<<fnum[i][1]<< " " << fnum[i][0] <<endl; used.push_back(fnum[i][1]);}  
  rep(i,2){cout<<snum[i][1]<< " " << snum[i][0] <<endl; used.push_back(snum[i][1]);}  
  rep(i,2){cout<<tnum[i][1]<< " " << tnum[i][0] <<endl; used.push_back(tnum[i][1]);}
  int cnt = 0;
  int num = 0;
 
  while(cnt<2){
    bool next = false;
    rep(i,used.size()){
      if(anum[num][1]==used[i]){
	num++;
	next = true;
	break;
      }
    }
    if(next)continue;
    cout<< anum[num][1] <<  " " << anum[num][0] << endl;
    used.push_back(anum[num][1]);
    cnt++;
  }
 
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, m, n) for(int i=(m); i<(n); ++i)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl
#define Cout2(x, y) cout << (x) << " " << (y) << endl
#define dump(x) cout << #x << " = " << (x) << endl;
#define forauto(i, a) for(auto i : a)cout << i << " "; puts("");
typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
const int inf = 1e9;
const double pi = acos(-1.0);

int main() {
	vector<vector<pair<double, int>>> a(3, vector<pair<double, int>>(8));
	rep(i, 24)cin >> a[i / 8][i % 8].second >> a[i / 8][i % 8].first;
	rep(i, 3)sort(all(a[i]));
	//rep(i, 6)Cout2(a[i / 2][i % 2].second, a[i / 2][i % 2].first);
	rep(i, 6) { cout << a[i / 2][i % 2].second; printf(" %.2f\n", a[i / 2][i % 2].first); }

	vector<pair<double, int>> b;
	rep(i, 18)b.pb(a[i / 6][i % 6 + 2]);
	sort(all(b));
	//rep(i, 2)Cout2(b[i].second, b[i].first);
	rep(i, 2) { cout << b[i].second; printf(" %.2f\n", b[i].first); }
}

C++: #include<stdio.h>
#include<iostream>
using namespace std;

struct ply{int cl;int nu;int m;int s;int A;};

int main()
{

ply NUM[4][25],M1,M2,M3,T;
for(int ii=0;ii<3;ii++)
{
	
	for(int i=0;i<8;i++)
	{
		NUM[ii][i].cl=ii;
		scanf("%d %d.%d",&NUM[ii][i].nu,&NUM[ii][i].m,&NUM[ii][i].s);
		NUM[ii][i].A=100*NUM[ii][i].m+NUM[ii][i].s;
	}
	for(int i=0;i<8;i++)
		for(int j=7;j>i;j--)
			if(NUM[ii][i].A>NUM[ii][j].A)swap(NUM[ii][i],NUM[ii][j]);

}
M1=NUM[0][2];M2=NUM[1][2];M3=NUM[2][2];
if(M1.A<M2.A)swap(M1,M2);
if(M1.A<M3.A)swap(M1,M3);
if(M2.A<M3.A)swap(M2,M3);
for(int i=0;i<2;i++){
		for(int j=0;j<1;j++){
			if(NUM[i][j].s/10>0)cout<<NUM[i][j].nu<<" "<<NUM[i][j].m<<"."<<NUM[i][j].s<<endl;
			else if(NUM[i][j].s/10==0)cout<<NUM[i][j].nu<<" "<<NUM[i][j].m<<"."<<"0"<<NUM[i][j].s<<endl;
		}
}
if(M.s/10>0)cout<<M3.nu<<" "<<M3.m<<"."<<M3.s<<endl;
else if(M3.s/10==0)cout<<M3.nu<<" "<<M3.m<<"."<<"0"<<M3.s<<endl;

if(M2.s/10>0)cout<<M2.nu<<" "<<M2.m<<"."<<M2.s<<endl;
else if(M2.s/10==0)cout<<M2.nu<<" "<<M2.m<<"."<<"0"<<M2.s<<endl;

return 0;
}

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

bool cmp(pair<int,double> A ,pair<int,double> B){
	return A.second < B.second;
}
int main(){
	int t;
	double td;
	deque < pair<int,double> > a;
	vector< pair<int,double> > b;
	vector< pair<int,double> > ret;
	for(int i=0;i<8;i++){
		cin >> t >> td;
		a.push_back(make_pair(t,td));
	}
	sort(a.begin(),a.end(),cmp);
	ret.push_back(a[0]);a.pop_front();
	ret.push_back(a[0]);a.pop_front();
	for(int i=0;i<6;i++){
		b.push_back(a[i]);
	}
	a.clear();
	for(int i=0;i<8;i++){
		cin >> t >> td;
		a.push_back(make_pair(t,td));
	}
	sort(a.begin(),a.end(),cmp);
	ret.push_back(a[0]);a.pop_front();
	ret.push_back(a[0]);a.pop_front();
	for(int i=0;i<6;i++){
		b.push_back(a[i]);
	}
	a.clear();
	for(int i=0;i<8;i++){
		cin >> t >> td;
		a.push_back(make_pair(t,td));
	}
	sort(a.begin(),a.end(),cmp);
	ret.push_back(a[0]);a.pop_front();
	ret.push_back(a[0]);a.pop_front();
	for(int i=0;i<6;i++){
		b.push_back(a[i]);
	}
	sort(b.begin(),b.end(),cmp);
	for(int i=0;i<2;i++){
		ret.push_back(b[i]);
	}
	for(int i=0;i<ret.size();i++){
		printf("%d %.2lf\n",ret[i].first,ret[i].second);
	}
}