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 <cstdlib>
#include <cmath>
#include <climits>
#include <cctype>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
using namespace std;

typedef vector<int> VI;
typedef vector<VI> VII;
typedef pair<int, int> PII;
typedef long long ll;

#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back;
#define MP make_pair

const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = INT_MAX / 3;

int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, -1, 0, 1};

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

typedef pair<double, int> P;

vector<P> a;

int main(void){
  for(int i = 0; i < 3; i++){
    vector<P> p(8, P(0.0, 0));
    for(int j = 0; j < 8; j++) cin >> p[j].second >> p[j].first;
    sort(ALL(p));
    cout << p[0].second << " " << p[0].first << endl;
    cout << p[1].second << " " << p[1].first << endl;
    p.erase(p.begin()); p.erase(p.begin());
    a.insert(a.begin(), p.begin(), p.end());
  }
  sort(ALL(a));
  cout << a[0].second << " " << a[0].first << endl;
  cout << a[1].second << " " << a[1].first << endl;
  return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<cstdio>
using namespace std;
struct ti{
long n;
double t;
} tti;
bool operator<(const ti& l,const ti& r){return l.t<r.t;}
int main(){
long f,i;
vector<ti> vt,vt2;
for(i=0;i<8;i++){cin>>tti.n>>tti.t;vt.push_back(tti);}
sort(vt.begin(),vt.end());
for(f=0,i=0;i<8;i++){
if(f<2){printf("%d %.2f\n",vt[i].n,vt[i].t);f++;}
else vt2.push_back(vt[i]);
}
vt.clear();
for(i=0;i<8;i++){cin>>tti.n>>tti.t;vt.push_back(tti);}
sort(vt.begin(),vt.end());
for(f=0,i=0;i<8;i++){
if(f<2){printf("%d %.2f\n",vt[i].n,vt[i].t);f++;}
else vt2.push_back(vt[i]);
}
vt.clear();
for(i=0;i<8;i++){cin>>tti.n>>tti.t;vt.push_back(tti);}
sort(vt.begin(),vt.end());
for(f=0,i=0;i<8;i++){
if(f<2){printf("%d %.2f\n",vt[i].n,vt[i].t);f++;}
else vt2.push_back(vt[i]);
}
sort(vt2.begin(),vt2.end());
for(f=0,i=0;i<18;i++){
if(f<2){printf("%d %.2f\n",vt2[i].n,vt2[i].t);f++;}
}
return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
using namespace std ;

typedef struct pair<double,int> Pid ;
#define F first
#define S second

vector<Pid> V1 ;
vector<Pid> V2 ;
vector<Pid> V3 ;
vector<Pid> V4 ;

int main(){
	
	int x ;
	double t ;
	for( int i=0 ; i<8 ; i++ ){
		cin >> x >> t ;
		V1.push_back( Pid(t,x) ) ;
	};
	for( int i=0 ; i<8 ; i++ ){
		cin >> x >> t ;
		V2.push_back( Pid(t,x) ) ;
	}
	for( int i=0 ; i<8 ; i++ ){
		cin >> x >> t ;
		V3.push_back( Pid(t,x) ) ;
	}
	
	sort( V1.begin() , V1.end() ) ;
	sort( V2.begin() , V2.end() ) ;
	sort( V3.begin() , V3.end() ) ;
	
	for( int i=2 ; i<8 ; i++ ){
		t = V1[i].F ; x = V1[i].S ;
		V4.push_back( Pid(t,x) ) ;
	}
	for( int i=2 ; i<8 ; i++ ){
		t = V2[i].F ; x = V2[i].S ;
		V4.push_back( Pid(t,x) ) ;
	}
	for( int i=2 ; i<8 ; i++ ){
		t = V3[i].F ; x = V3[i].S ;
		V4.push_back( Pid(t,x) ) ;
	}
	sort( V4.begin() , V4.end() ) ;
	
	for( int i=0 ; i<2 ; i++ ) printf("%d %.2lf\n",V1[i].S ,V1[i].F) ; 
	for( int i=0 ; i<2 ; i++ ) printf("%d %.2lf\n",V2[i].S ,V2[i].F) ;
	for( int i=0 ; i<2 ; i++ ) printf("%d %.2lf\n",V3[i].S ,V3[i].F) ;
	for( int i=0 ; i<2 ; i++ ) printf("%d %.2lf\n",V4[i].S ,V4[i].F) ;
	
return 0 ;
}

C++: #include<stdio.h>
#include<utility>
#include<algorithm>
#include<limits>
using namespace std;
int main()
{
	const int N1 = 3, N2=8;
	int i,j;
	pair<double,int>a[N2], w1,w2;
	w1.first = w2.first = numeric_limits<double>::max();
	for(i=0;i<N1;++i)
	{
		for(j=0;j<N2;++j)
		{
			scanf("%d %lf",&a[j].second, &a[j].first);
		}
		sort(a, a+N2);
		for(j=0;j<2;++j)
			printf("\t%d %.2f\n",a[j].second, a[j].first);
		for(j=2;j<4;++j)
		{
			if(w1.first > a[j].first)
			{
				w2=w1;
				w1=a[j];
			}
			else if(w2.first > a[j].first)
				w2 = a[j];
		}	
	}
	printf("\t%d %.2f\n"
		"\t%d %.2f\n", w1.second, w1.first, w2.second, w2.first);
	return 0;
}

C++: #include <iostream>
#include <map>
#include <vector>
using namespace std;
int main(){
	map<double, int> n_t;
	int race = 3;
	int num;
	double t;
	vector<double> rank, all;
	while( race-- > 0 ){
		for( int i = 0; i < 8; i++ ){
			cin >> num >> t;
			n_t[t] = num;
			rank.push_back(t);
		}
		sort(rank.begin(), rank.end());
		vector<double>::iterator it = rank.begin();
		cout << n_t[*it] << ' ' << *it << endl;
		//rank.erace(it);
		it++;
		cout << n_t[*it] << ' ' << *it << endl;
		it++;
		for( ; it != rank.end(); it++ ){
			all.push_back(*it);
		}
		rank.clear();
	}
	sort(all.begin(), all.end());
	vector<double>::iterator it = all.begin();
	cout << n_t[*it] << ' ' << *it << endl;
	it++;
	cout << n_t[*it] << ' ' << *it << endl;

	return 0;
}

C++: #include <iostream>
#include <limits.h>

using namespace std;


struct p_tag {
	int num;
	double time;
} P[3][8], tmp;

void sort()
{
	int i, j, k;
	for( i=0; i<3; i++ ){
		for( j=0; j<8; j++ ){
			for( k=j+1; k<8; k++ ){
				if( P[i][j].time > P[i][k].time ){
					tmp = P[i][j];
					P[i][j] = P[i][k];
					P[i][k] = tmp;
				}
			}
		}
	}

	return;
}


int main(void)
{
	int i, j, min;

	for( i=0; i<3; i++ )
		for( j=0; j<8; j++ )
			cin >> P[i][j].num >> P[i][j].time;

	sort();

	for( i=0; i<3; i++ )
		for( j=0; j<2; j++ )
			printf("%d %.2f\n", P[i][j].num, P[i][j].time );


	for( i=0; i<2; i++ ){
		min = 0;
		for( j=1; j<3; j++ )
			if( P[min][2].time > P[j][2].time )
				min = j;
		printf("%d %.2f\n", P[min][2].num, P[min][2].time );
		P[min][2].time = INT_MAX;
	}

	return 0;
}