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 <cstdio>
#include <string>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <iomanip>
#include <vector>
#include <queue>



using namespace std;

typedef pair<double, int> P;

int main()
{
	int num;
	double time;
	
	vector<P> remain;
	for (int i=0; i<3; i++)
	{
		vector<P> men;
		
		for (int j=0; j<8; j++)
		{
			cin >> num >> time;
			men.push_back(P(time, num));
		}
		
		sort(men.begin(), men.end());
		
		printf("%d %.2lf\n", men[0].second, men[0].first);
		printf("%d %.2lf\n", men[1].second, men[1].first);
		for (int j=2; j<men.size(); j++) remain.push_back(men[j]);
		
		/*
		for (int j=0; j<men.size(); j++)
		{
			cout << men[j].first << " : " << men[j].second << endl;
		}
		*/
	}
	
	sort(remain.begin(), remain.end());
	printf("%d %.2lf\n", remain[0].second, remain[0].first);
	printf("%d %.2lf\n", remain[1].second, remain[1].first);
	
	
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<queue>
#include<map>
#include<functional>
#include<vector>
#define rep(i,k) for(int i=0;i<k;i++)
using namespace std;
typedef pair<double,int> P;
int main(){
	int x;
	double y;
	priority_queue<P,vector<P>,greater<P> > a[3];
	priority_queue<P,vector<P>,greater<P> > b;
	rep(i,3){
		rep(j,8){
			cin>>x>>y;
			a[i].push(P(y,x));
		}
		rep(k,2){
			P q=a[i].top();
			printf("%d %.2lf\n",q.second,q.first);
			a[i].pop();
		}
		rep(k,6){
			b.push(a[i].top());
			a[i].pop();
		}
	}
	rep(k,2){
		P p=b.top();
		printf("%d %.2lf\n",p.second,p.first);
		b.pop();
	}
	return 0;
}

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

#define N 8

class P{
    public:
    int id;
    double score;
    P( int i=0, double s=0):id(i), score(s){}

    bool operator < ( const P &p ) const{
	return score < p.score;
    }
};

main(){
    P A[N], B[N], C[N], D[3*N];
    int n;
    for ( int i = 0; i < N; i++ ) {cin >> A[i].id >> A[i].score; }
    for ( int i = 0; i < N; i++ ) {cin >> B[i].id >> B[i].score; }
    for ( int i = 0; i < N; i++ ) {cin >> C[i].id >> C[i].score; }
    sort( A, A + N );
    sort( B, B + N );
    sort( C, C + N );
    int k = 0;
    for ( int i = 2; i < N; i++ ) D[k++] = A[i];
    for ( int i = 2; i < N; i++ ) D[k++] = B[i];
    for ( int i = 2; i < N; i++ ) D[k++] = C[i];
    sort( D, D + k );	      

    for ( int i = 0; i < 2; i++ ) cout << A[i].id << " " << A[i].score <<endl;
    for ( int i = 0; i < 2; i++ ) cout << B[i].id << " " << B[i].score <<endl;
    for ( int i = 0; i < 2; i++ ) cout << C[i].id << " " << C[i].score <<endl;
    for ( int i = 0; i < 2; i++ ) cout << D[i].id << " " << D[i].score <<endl;


    
}

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

void bubbleSort( int* a, double* b, int n )
{
    for( int i = 0; i < n; i++ )
        for( int j = n - 1; j >= i + 1; j-- )
        {
            if( b[j] < b[j-1] )
            {
                double temp1 = b[j];
                b[j] = b[j-1];
                b[j-1] = temp1;
                
                int temp2 = a[j];
                a[j] = a[j-1];
                a[j-1] = temp2;
            }
        }
}

int main()
{
    int a[8], c[18];
    double b[8], d[18];

    for( int j = 0; j < 3; j++ )
    {
        for( int i = 0; i < 8; i++ )
            cin >> a[i] >> b[i];

        bubbleSort( a, b, 8 );
        cout << fixed << setprecision(2) << a[0] << " " << b[0] << endl;
        cout << fixed << setprecision(2) << a[1] << " " << b[1] << endl;
        for( int i = 2; i < 8; i++ )
        {
            c[i+j*6-2] = a[i];
            d[i+j*6-2] = b[i];
        }
    }

    bubbleSort( c, d, 18 );
    cout << fixed << setprecision(2) << c[0] << " " << d[0] << endl;
    cout << fixed << setprecision(2) << c[1] << " " << d[1] << endl;

    return 0;
}

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

int main(){
	double t[25] = {};
	vector<double> ans;
	vector<double> p;

	for(int i=0 ; i<3 ; ++i ){
		vector<double> vc;
		for(int j=0 ; j<8 ; ++j ){
			int No;
			double time;
			scanf("%d %lf", &No , &time );
			t[No] = time;
			vc.push_back(time);
			p.push_back(time);
		}
		sort( vc.begin() , vc.end() );
		ans.push_back( vc[0] );
		ans.push_back( vc[1] );
	}
	vector<double> foo;
	for(int i=0 ; i<p.size() ; ++i){
		bool flag = true;
		for(int j=0 ; j<(int)ans.size() ; ++j )
			if( p[i] == ans[j] )
				flag = false;
		
		if( flag )
			foo.push_back( p[i] );
	}
	sort( foo.begin() , foo.end() );
	ans.push_back( foo[0] );
	ans.push_back( foo[1] );
	
	for(int i=0 ; i<(int)ans.size() ; ++i ){
		for(int j=0 ; j<25 ; ++j ){
			if( t[j] == ans[i] )
				printf("%d %.2f\n", j , ans[i] );
		}
	}
}