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<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
main(){
  pair<double,int>x[3];
  r(i,3){
    pair<double,int>p[8];
    r(j,8)cin>>p[j].second>>p[j].first;
    sort(p,p+8);
    cout<<p[0].second<<' '<<p[0].first<<endl;
    cout<<p[1].second<<' '<<p[1].first<<endl;
    x[i].second=p[2].second;
    x[i].first=p[2].first;
  }
  sort(x,x+3);
  cout<<x[0].second<<' '<<x[0].first<<endl;
  cout<<x[1].second<<' '<<x[1].first<<endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	int a[3][3];
	double d[3][3];
	for(int p=0;p<3;p++){
	for(int i=0;i<8;i++){
		int b;
		double c;
		cin>>b>>c;
		for(int j=0;j<3;j++){
			if(c<d[p][j]){
				double e=d[p][0];
				int f=0;
				for(int z=0;z<3;z++){
					if(e<d[p][z]){
						f=z;
						e=d[p][z];
					}
				}
				d[p][f]=c;
				a[p][f]=b;
			}
		}
	}
	}
	int l[3];
	double m[3];
	for(int i=0;i<3;i++){
		int g=10000;
		int h,k;
		for(int j=0;j<3;j++){
			if(g>d[i][j]){g=d[i][j];h=j;}
		}
		cout<<a[i][h]<<" "<<d[i][h]<<endl;
		g=10000;
		for(int j=0;j<3;j++){
			if(g>d[i][j]&&j!=h){g=d[i][j];k=j;}
		}
		cout<<a[i][k]<<" "<<d[i][h]<<endl;
		for(int j=0;j<3;j++){
			if(j!=h&&j!=k){l[i]=a[i][j];m[i]=d[i][j];}
		}
	}
	int n=10000;
	int o,p;
	for(int j=0;j<3;j++){
		if(n>l[j]){n=l[j];o=j;}
	}
	cout<<m[o]<<" "<<l[o]<<endl;
	n=10000;
	for(int j=0;j<3;j++){
		if(n>l[j]&&j!=o){n=l[j];p=j;}
	}
	cout<<m[p]<<" "<<l[p]<<endl;
}

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

using namespace std;

struct DATA{
  int Number;
  double Time;
};

bool compare(const DATA&, const DATA&);

int main(){
  int i, j, number;
  double time;
  DATA person;
  vector<DATA> data, win, lose;

  for(i=0; i<3; ++i){
    for(j=0; j<8; ++j){
      cin >> number >> time;
      person.Number = number;
      person.Time = time;
      data.push_back(person);
    }

    sort(data.begin(), data.end(), compare);
    win.push_back(data[0]);
    win.push_back(data[1]);

    for(j=2; j<8; ++j)
      lose.push_back(data[j]);

    data.clear();
  }

  sort(lose.begin(), lose.end(), compare);

  win.push_back(lose[0]);
  win.push_back(lose[1]);

  for(i=0; i<win.size(); ++i){
    cout << win[i].Number << " ";
    cout.setf(ios::fixed, ios::floatfield);
    cout.precision(2);
    cout << win[i].Time << endl;
  }

  return 0;
}

bool compare(const DATA& x, const DATA& y){
  return x.Time < y.Time;
}

C++: #include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#define INF 1000000
using namespace std;
typedef pair<double, int> P;

vector<P> V;

int main() {
  P temp;
  bool r=false;
  for(int i=0;i<24;i++) {
    cin >> temp.second >> temp.first;
    V.push_back(temp);
  }

  for(int i=0;i<3;i++) {
    sort(V.begin()+ (8 * i) ,V.begin()+(8 * i + 8));
    for(int j=0;j<2;j++) {
      temp = V[8*i+j];
      printf("%d %.2lf\n",temp.second,temp.first);
      vector<P>::iterator it = V.begin() + (8 * i+j);
      it = V.erase(it);
      temp.first = INF;
      V.insert(it,temp);
    }
  }
  sort(V.begin(),V.end());
  for(int i=0;i<2;i++) {
    temp = V[i];
    printf("%d %.2lf\n",temp.second,temp.first);
  }
}

C++: #include <iostream>
#include <cstdio>
#include <queue>
#include <utility>
using namespace std;

typedef pair<double, int> P;

int main(){
    priority_queue< P > que[4];
    int i,j,n;
    double t;
    for(i=0;i<3;i++){
        for(j=0;j<8;j++){
            cin>>n>>t;
            que[i].push( P(-t, n) );
        }
    }
    for(i=0;i<3;i++){
        for(j=0;j<2;j++){
            P tmp = que[i].top();
            que[i].pop();
            printf("%d %.2lf\n",tmp.second,-tmp.first);
        }
        while( !que[i].empty() ){
            que[3].push( que[i].top() );
            que[i].pop();
        }
    }
    for(i=0;i<2;i++){
        P tmp = que[3].top();
        que[3].pop();
        printf("%d %.2lf\n",tmp.second,-tmp.first);
    }
    return 0;
}

C++: #pragma warning(disable:4996)

#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <cstdio>

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

using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<double, int> pii;

int main(){
    vector<pii> v(24);
    rep(i, 24){
        int a;
        double t;
        scanf("%d %lf", &a, &t);
        v[i] = make_pair(t, a);
    }

    rep(i, 3){
        sort(v.begin() + 8 * i, v.begin() + 8 * i + 8);
    }
    vector<pii> ans;
    rep(i, 3)rep(j, 6){
        ans.push_back(v[i * 8 + j + 2]);
    }
    sort(all(ans));

    rep(i, 3) rep(j, 2){
        printf("%d %.2f\n", v[i * 8 + j].second, v[i * 8 + j].first);
    }
    rep(i, 2){
        printf("%d %.2f\n", ans[i].second, ans[i].first);
    }
}

C++: #include <cstdio>
#include <map>
using namespace std;
int main(void){
	map<int,int> remain;
	for(int i=0;i<3;++i){
		map<int,int> group;
		for(int j=0,num,p,q;j<8;++j){
			scanf("%d %d.%2d",&num,&p,&q);
			group[p*100+q]=num;
		}
		int j=0;
		for(map<int,int>::iterator it=group.begin();it!=group.end();++it){
			if(j<2) printf("%d %d.%02d\n",(*it).second,(*it).first/100,(*it).first%100);
			else remain[(*it).first] = (*it).second;
			++j;
		}
		
	}
	int i=0;
	for(map<int,int>::iterator it=remain.begin();it!=remain.end();++it){
		if(i<2) printf("%d %d.%02d\n",(*it).second,(*it).first/100,(*it).first%100);
		++i;
	}
	return 0;
}