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


typedef struct{
    int backnum;
    double time;
} runner;

void q_sort(runner data[], int begin, int end);

int main(int argc, const char * argv[])
{
    int a = 0;
    runner data[3][8];
    runner under[6];
    for (int i = 0; i < 3; i++) {
        for (int k = 0; k < 8; k++) {
            cin >> data[i][k].backnum >> data[i][k].time;
        }
    }
    for (int i = 0; i < 3; i++) {
        q_sort(data[i], 0, 7);
    }
    for (int i = 0; i < 3; i++){
        for (int k = 2; k < 4; k++) {
            under[a] = data[i][k];
            a++;
        }
    }
    q_sort(under, 0, 5);
    for (int i = 0; i < 3; i++) {
        for (int k = 0; k < 2; k++) {
            printf("%d %.2f\n", data[i][k].backnum, data[i][k].time);
        }
    }
    for (int i = 0; i < 2; i++) {
        printf("%d %.2f\n", under[i].backnum, under[i].time);
    }
    return 0;
}

void q_sort(runner data[], int begin, int end){
    int i = begin;
    int k = end;
    runner pivot;
    runner temp;
    pivot = data[(begin + end) / 2];
    while (1) {
        while (data[i].time < pivot.time) {
            i++;
        }
        while (pivot.time < data[k].time) {
            k--;
        }
        if (i >= k) {
            break;
        }
        temp = data[i];
        data[i] = data[k];
        data[k] = temp;
        i++;
        k--;
    }
    if (begin < i - 1) {
        q_sort(data, begin, i - 1);
    }
    if (k + 1 < end) {
        q_sort(data, k + 1, end);
    }
}

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

using namespace std;
typedef pair<double, int> P;

void solve()
{
	priority_queue<P, vector<P>, greater<P> > PQue;
	for(int i = 0; i < 3; ++i)
	{
		vector<P> Vec(8);
		for(int j = 0; j < 8; ++j)
		{
			cin >> Vec[j].second >> Vec[j].first;
		}
		sort(Vec.begin(), Vec.end());
		printf("%d %.2f\n", Vec[0].second, Vec[0].first);
		printf("%d %.2f\n", Vec[1].second, Vec[1].first);
		for(int j = 2; j < 8; ++j)
		{
			PQue.push(Vec[j]);
		}
	}
	printf("%d %.2f\n", PQue.top().second, PQue.top().first);
	PQue.pop();
	printf("%d %.2f\n", PQue.top().second, PQue.top().first);
}

int main()
{
	solve();
	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());
	reverse(a.begin(),a.end());
	sort(b.begin(),b.end());
	reverse(b.begin(),b.end());
	sort(c.begin(),c.end());
	reverse(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());
	reverse(a.begin(),a.end());
	cout<<a[17].second<<' '<<a[17].first<<endl;
	cout<<a[16].second<<' '<<a[16].first<<endl;
	
	return 0;
		
	}

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;
				break;
			}
		}
	}
	}
	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][k]<<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 <cstdio>
#include <utility>
#include <vector>
#include <algorithm>
using namespace std;

typedef pair<double, int> Player;

int main(void){  
  vector<Player> group[3], losers;
  
  for (int i=0; i<3; i++){
    for (int j=0; j<8; j++){
      int id;
      double tm;
      cin >> id >> tm;
      group[i].push_back(make_pair(tm, id));
    }
    sort(group[i].begin(), group[i].end());
    for (int j=0; j<8; j++){
      Player p = group[i][j];
      if (j<2){
        printf("%d %2.2f\n", p.second, p.first);
      } else {
        losers.push_back(p);
      }
    }
  }
  sort(losers.begin(), losers.end());
  for (int i=0; i<2; i++){
    Player p = losers[i];
    printf("%d %2.2f\n", p.second, p.first);
  }
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <map>
#include <utility>
using namespace std;
#define rep2(x,from,to) for(int x=(from);x<(to);++(x))
#define rep(x,to) rep2(x,0,to)

int main() {
	map<double, int> m;
	map<double, int> ma;
	int n;
	double t;
	rep(i,3) {
		rep(j,8) {
			cin >> n >> t;
			m.insert(make_pair(t,n));
		}
		auto it = m.begin();
		rep(j,2) {
			cout << (*it).second << " ";
			printf("%.2lf\n", (*it).first);
			++it;
		}
		ma.insert(*it);
		m.clear();
	}
	auto it2 = ma.begin();
	rep(i,2) {
		cout << (*it2).second << " ";
		printf("%.2lf\n", (*it2).first);
		++it2;
	}
	return 0;
}