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<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[24];
  bool used[24];
  for(int i=0;i<24;i++){cin >> info[i].F >> info[i].S;used[i] = false;}
  sort(info,info+7,cmp);
  printf("%d %.2f\n",info[0].F,info[0].S);used[info[1].F] = true;
  printf("%d %.2f\n",info[1].F,info[1].S);used[info[0].F] = true;
  sort(info+8,info+15,cmp);
  printf("%d %.2f\n",info[8].F,info[8].S); used[info[8].F] = true;
  printf("%d %.2f\n",info[9].F,info[9].S); used[info[9].F] = true;
  sort(info+16,info+23,cmp);
  printf("%d %.2f\n",info[16].F,info[16].S); used[info[16].F] = true;
  printf("%d %.2f\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 %.2f\n",info[i].F,info[i].S);
    }
    if(cnt == 2)break;
  }

}

C++: #include<bits/stdc++.h>
using namespace std;
typedef long long int lld;
typedef pair<double,int> P;

int main(){
  P player[24];
  P race[3][8];
  map<int,int> used;
  for(int i=0;i<3;i++){
    for(int j=0;j<8;j++){
      cin >> player[i*8+j].second >> player[i*8+j].first;
      race[i][j] = player[i*8+j];
    }
  }
  for(int i=0;i<3;i++){
    sort(race[i],race[i]+8);
    for(int j=0;j<2;j++){
      cout << race[i][j].second << " " << race[i][j].first << endl;;
      used[race[i][j].second] = 1;
    }
  }
  sort(player,player+24);
  int cnt=0,idx=0;
  while(cnt != 2){
    if(used[player[idx].second] == 0){
      cout << player[idx].second << " " <<  player[idx].first << endl;
      cnt++;
    }
    idx++;
  }
}

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

using namespace std;

int num[8];
double runtime[8];
int num3[18];
double runtime3[18];


void bubble_sort1(void){

  for( int i = 0 ; i < 7 ; i++ ){
    for( int j = 7 ; j > i ; j-- ){
      if( runtime[j - 1] > runtime[j] ){

	double temp = runtime[j - 1];
	runtime[j - 1] = runtime[j];
	runtime[j] = temp;

	temp = num[j - 1];
	num[j - 1] = num[j];
	num[j] = temp;

      }
    }
  }

}


void bubble_sort2(void){

  for( int i = 0 ; i < 17 ; i++ ){
    for( int j = 17 ; j > i ; j-- ){
      if( runtime3[j - 1] > runtime3[j] ){

	double temp = runtime3[j - 1];
	runtime3[j - 1] = runtime3[j];
	runtime3[j] = temp;

	temp = num3[j - 1];
	num3[j - 1] = num3[j];
	num3[j] = temp;

      }
    }
  }

}

int main(void){

  int n = 3;
  int I = 0;

  while(n--){

    for( int i = 0 ; i < 8 ; i++ ){
      scanf("%d %lf",&num[i],&runtime[i]);
    }

    bubble_sort1();

    //cout << "---" << endl;
    cout << num[0] << " " << runtime[0] << endl;
    cout << num[1] << " " << runtime[1] << endl;
    // cout << "---" << endl;
 
    for( int i = 2 ; i < 8 ; i++ ){
      num3[I] = num[i];
      runtime3[I] = runtime[i];
      I++;
    }

  }
    bubble_sort2();

    cout << num3[0] << " " << runtime3[0] << endl;
    cout << num3[1] << " " << runtime3[1] << endl;
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
typedef pair<double,int> P;

int main(){
	vector<P>a,b,c;
	for(int i=0;i<8;i++){
		int num;
		double t;
		cin>>num>>t;
		a.push_back(P(t,num));
		}
	for(int i=0;i<8;i++){
		int num;
		double t;
		cin>>num>>t;
		b.push_back(P(t,num));
		}	
	for(int i=0;i<8;i++){
		int num;
		double t;
		cin>>num>>t;
		c.push_back(P(t,num));
		}	
	sort(a.begin(),a.end());
	sort(b.begin(),b.end());
	sort(c.begin(),c.end());
	cout<<a[7].second<<' '<<a[7].first<<endl;
	cout<<a[6].second<<' '<<a[6].first<<endl;
	cout<<b[7].second<<' '<<b[7].first<<endl;
	cout<<b[6].second<<' '<<b[6].first<<endl;
	cout<<c[7].second<<' '<<c[7].first<<endl;
	cout<<c[6].second<<' '<<c[6].first<<endl;
	for(int i=0;i<2;i++)a.pop_back();
	for(int i=0;i<2;i++)b.pop_back();
	for(int i=0;i<2;i++)c.pop_back();
	
	for(int i=0;i<6;i++)a.push_back(b[i]);
	for(int i=0;i<6;i++)a.push_back(c[i]);
	sort(a.begin(),a.end());
	cout<<a[17].second<<' '<<a[17].first<<endl;
	cout<<a[16].second<<' '<<a[16].first<<endl;
	
	return 0;
		
	}

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

using namespace std;

typedef pair<double,int> P;

int main(){
  int a;
  double t;

  vector<P> v1,v2,v3,v;
  for(int i = 0 ; i < 8 ; i++){
    cin >> a >> t;
    v1.push_back(P(t,a));
  }
  sort(v1.begin(),v1.end());

  printf("%d %.2f\n" ,v1[0].second ,v1[0].first);
  printf("%d %.2f\n" ,v1[1].second ,v1[1].first);

  for(int i = 2 ; i < 4 ; i++){
    v.push_back(v1[i]);
  }

  for(int i = 0 ; i < 8 ; i++){
    cin >> a >> t;
    v2.push_back(P(t,a));
  }
  sort(v2.begin(),v2.end());

  printf("%d %.2f\n" ,v2[0].second ,v2[0].first);
  printf("%d %.2f\n" ,v2[1].second ,v2[1].first);

  for(int i = 2 ; i < 4 ; i++){
    v.push_back(v2[i]);
  }

  for(int i = 0 ; i < 8 ; i++){
    cin >> a >> t;
    v3.push_back(P(t,a));
  }
  sort(v3.begin(),v3.end());

  printf("%d %.2f\n" ,v3[0].second ,v3[0].first);
  printf("%d %.2f\n" ,v3[1].second ,v3[1].first);

  for(int i = 2 ; i < 4 ; i++){
    v.push_back(v3[i]);
  }

  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);

  return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define MP make_pair
#define PB push_back

typedef pair<double, int> pdi;
typedef vector<pdi> vp;

int main() {
	vp v[4];
	
	REP(i, 3) {
		REP(j, 8) {
			int num;
			double t;
			scanf("%d %lf", &num, &t);
			v[i].PB(MP(t, num));
		}
		sort(v[i].begin(), v[i].end());
	}
	
	REP(i, 3) {
		REP(j, 2) {
			cout << v[i][j].second << " " << v[i][j].first << endl;
		}
		FOR(j, 2, 8)
			v[3].PB(v[i][j]);
	}
	
	sort(v[3].begin(), v[3].end());
	REP(i, 2) cout << v[3][i].second << " " << v[3][i].first << endl;
	
	return 0;
}