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

int main(){
  int p[24];
  double t[24];
  double min1,min2;
  int ansp[8];
  vector<int>losep;
  double anst[8];
  vector<double> loset;

  for(int i=0;i<24;i++)cin >> p[i] >> t[i];

  for(int j=0;j<3;j++){
    min1 = 1e+9;
    min2 = 1e+9;
    for(int i=j*8;i<(j+1)*8;i++){
      if(min1>t[i]){
	min2 = min1;
	min1 = t[i];
      }else if(min2>t[i])min2 = t[i];
    }
    for(int i=j*8;i<(j+1)*8;i++){
      if(min1==t[i]){
	ansp[j*2] = p[i];
	anst[j*2] = t[i];
      }else if(min2==t[i]){
	ansp[j*2+1] = p[i];
	anst[j*2+1] = t[i];
      }else{
	losep.push_back(p[i]);
	loset.push_back(t[i]);
      }
    }
  }
  min1 = 1e+9;
  min2 = 1e+9;
  for(int i=0;i<18;i++){
     if(min1>loset[i]){
	min2 = min1;
	min1 = loset[i];
     }else if(min2>loset[i])min2 = loset[i];
  }
  for(int i=0;i<18;i++){
    if(min1==loset[i]){
      ansp[6] = losep[i];
      anst[6] = loset[i];
    }else if(min2==loset[i]){
      ansp[7] = losep[i];
      anst[7] = loset[i];
    }
  }
  for(int i=0;i<8;i++){
    printf("%d %.2lf\n",ansp[i],anst[i]);
  }
}

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

int main()
{
	vector< pair< double, int > > athletes;
	vector< pair< double, int > > finalists;

	for( int i = 0; i < 3; ++i ){
		vector< pair< double, int > > party;
		for( int j = 0; j < 8; ++j ){
			int id;
			double time;
			cin >> id >> time;
			party.push_back( make_pair( time, id ) );
		}
		sort( party.begin(), party.end(), greater< pair< double, int > >() );
		finalists.push_back( party[ 7 ] );
		finalists.push_back( party[ 6 ] );
		party.pop_back();
		party.pop_back();
		athletes.insert( athletes.end(), party.begin(), party.end() );
	}
	sort( athletes.begin(), athletes.end() );
	finalists.push_back( athletes[ 0 ] );
	finalists.push_back( athletes[ 1 ] );

	for( int i = 0; i < 8; ++i ){
		cout << finalists[ i ].second << " " << fixed << setprecision( 2 ) << finalists[ i ].first << endl;
	}

	return 0;
}

C++: #include<stdio.h>
#include<algorithm>
#include<functional>
using namespace std;
typedef pair<float,int> P;
int main(void)
{
	P a[8],b[8],c[8],d[18];
	int i,j,jj,jjj;
	for(i=0;i<8;i++){
		scanf("%d %f",&a[i].second,&a[i].first);
	}
//for(i=0;i<8;i++)	printf(" %d %f\n",a[i].first,a[i].second);
	sort(a,a+8);	
	for(i=0;i<8;i++){
		scanf("%d %f",&b[i].second,&b[i].first);
	}
	sort(b,b+8);
	for(i=0;i<8;i++){
		scanf("%d %f",&c[i].second,&c[i].first);
	}
	sort(c,c+8);
	
	for(i=0;i<6;i++){
		d[i].first=a[i+2].first;	
		d[i].second=a[i+2].second;	
		//printf("j=%d %f\n",d[i].second,d[i].first);
	}
	for(i=0;i<6;i++){
		d[i+6].first=b[i+2].first;
		d[i+6].second=b[i+2].second;		
		//printf("jj=%d %f\n",d[i+6].second,d[i+6].first);
	}
	for(i=0;i<6;i++){
		d[i+12]=c[i+2];
		//printf("jjj=%d %f\n",d[i+12].second,d[i+12].first);
	}
	//printf("%d %f\n",d[i].second,d[i].first);
	sort(d,d+18);
	//
	
	printf("%d %.2f\n",a[0].second,a[0].first);
	printf("%d %.2f\n",a[1].second,a[1].first);
	printf("%d %.2f\n",b[0].second,b[0].first);
	printf("%d %.2f\n",b[1].second,b[1].first);
	printf("%d %.2f\n",c[0].second,c[0].first);
	printf("%d %.2f\n",c[1].second,c[1].first);
	printf("%d %.2f\n",d[0].second,d[0].first);
	printf("%d %.2f\n",d[1].second,d[1].first);
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<map>
#define F first
#define S second
using namespace std;

int main(){

  int n;
  typedef pair <double , int> P;
  P d[10];
  P p[100];

  for(int i=0;i<3;i++){
    for(int j=0;j<8;j++) cin >> d[j].S >> d[j].F;
    sort(d,d+8);

    printf("%d %.2lf\n",d[0].S,d[0].F);
    printf("%d %.2lf\n",d[1].S,d[1].F);

    d[0].F = d[1].F = 1 << 28;

    int l = 0;
    for(int j=i*8;j<i*8+8;j++){
      p[j].F = d[l].F;
      p[j].S = d[l].S;
      l++;
    }

  
  }

  sort(p,p+24);

  printf("%d %.2lf\n",p[0].S,p[0].F);
  printf("%d %.2lf\n",p[1].S,p[1].F);

}

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

using namespace std;

int main()
{
    vector< pair<double, int> > pl1, pl2, pl3, pl;
    int id;
    double tm;

    for (int i = 0; i < 24; i++) {
        cin >> id >> tm;
        if (i / 8 == 0)
            pl1.push_back(pair<double, int>(tm, id));
        else if (i / 8 == 1)
            pl2.push_back(pair<double, int>(tm, id));
        else if (i / 8 == 2)
            pl3.push_back(pair<double, int>(tm, id));
    }
    sort(pl1.begin(), pl1.end());
    sort(pl2.begin(), pl2.end());
    sort(pl3.begin(), pl3.end());

    for (int i = 2; i < 8; i++) {
        pl.push_back(pl1[i]);
        pl.push_back(pl2[i]);
        pl.push_back(pl3[i]);
    }
    sort(pl.begin(), pl.end());

    for (int i = 0; i < 2; i++)
        cout << pl1[i].second << " " << pl1[i].first << endl;
    for (int i = 0; i < 2; i++)
        cout << pl2[i].second << " " << pl2[i].first << endl;
    for (int i = 0; i < 2; i++)
        cout << pl3[i].second << " " << pl3[i].first << endl;
    for (int i = 0; i < 2; i++)
        cout << pl[i].second << " " << pl[i].first << endl;

    return 0;
}