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 <algorithm>
using namespace std;
struct score{
	int n;
	double t;
};
int main(){
	score a[8],o[8],x,b[18];
	int c1 = 0,c2 = 0;
	for(int i = 0;i < 3;++i){
		for(int j = 0;j < 8;++j){
			cin >> x.n >> x.t;
			a[j] = x;
		}
		for(int j = 0;j < 8;++j){
			for(int k = 7;j < k;--k){
				if(a[j].t > a[k].t){
					swap(a[j],a[k]);
				}
			}
		}
		for(int j = 0;j < 8;++j){
			if(j < 2) {
				o[c1] = a[j];
				++c1;
			}
			else {
				b[c2] = a[j];
				++c2;
			}
		}
	}
	for(int i = 0;i < 18;++i){
		for(int j = 17;j > i;--j){
			if(b[i].t > b[j].t){
				swap(b[i],b[j]);
			}
		}
	}
	for(int i = 0;i < 2;++i){
		o[c1] = b[i];
		++c1;
	}
	for(int i = 0;i < 8;++i){
		printf("%d %.2f\n",o[i].n,o[i].t);
	}
	return 0;
}

C++: #include <stdio.h>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
#define PB push_back
#define F first
#define S second
#define MP make_pair
int main(){
    vector<pair<double,int>> v[3],all;
    pair<double,int> temp;
    for(int i=0;i<3;i++){
        for(int j=0;j<8;j++){
            scanf("%d%lf",&temp.S,&temp.F);
            v[i].PB(temp);
        }
        sort(v[i].begin(),v[i].end());
        for(int j=0;j<2;j++)printf("%d %.2lf\n",v[i][j].S,v[i][j].F);
        for(int j=2;j<8;j++)all.PB(v[i][j]);
    }
    sort(all.begin(),all.end());
    for(int i=0;i<2;i++)printf("%d %.2lf\n",all[i].S,all[i].F);
}

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

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(){
	int p[25];
	float t[25];
	bool x[25]={0};
	for(int i=1;i<25;i++){
		cin>>p[i]>>t[i];
	}
	for(int i=0;i<=16;i=i+8){
		float max=100.0,max2=100.0;
		int cnt=0,cnt2=0;
		for(int j=1;j<=8;j++){
			if(max2>t[j+i]){
				if(max>t[i+j]){
					max2=max;
					max=t[i+j];
					cnt2=cnt;
					cnt=i+j;
				}else{
					max2=t[i+j];
					cnt2=i+j;
				}
			}
		}
		x[cnt]=1,x[cnt2]=1;
		printf("%d %.2lf\n%d %.2lf\n",p[cnt],max,p[cnt2],max2);
	}
	float y=100.0,z=100.0;
	int cnt3=0,cnt4=0;
	for(int i=1;i<=24;i++){
		if(x[i]==0){
			if(z>t[i]){
				if(y>t[i]){
					z=y;
					y=t[i];
					cnt4=cnt3;
					cnt3=i;
				}else{
					z=t[i];
					cnt4=i;
				}
			}
		}
	}
	printf("%d %.2lf\n%d %.2lf\n",p[cnt3],y,p[cnt4],z);
	return 0;
}

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

int main(){
	double t[1000] = {};
	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] );
		}
	}
}

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

int main(void){
  int p;
  double t;
  double t7,t8;
  t7=100000000;
  t8=100000000;
  int p7,p8;
  for(int i=0;i<3;i++){
    int p1,p2,p3,p4;
    double t1,t2,t3,t4;
    t1=100000000;
    t2=100000000;
    t3=100000000;
    t4=100000000;
    for(int j=0;j<8;j++){
      cin>>p>>t;
      if(t<t1){
        t4=t3;
        t3=t2;
        t2=t1;
        t1=t;
        p4=p3;
        p3=p2;
        p2=p1;
        p1=p;
      }
      else if(t<t2){
        t4=t3;
        t3=t2;
        t2=t;
        p4=p3;
        p3=p2;
        p2=p;
      }
      else if(t<t3){
        t4=t3;
        t3=t;
        p4=p3;
        p3=p;
      }
      else if(t<t4){
        t4=t;
        p4=p;
      }
    }
    cout<<p1<<" "<<t1<<endl;
    cout<<p2<<" "<<t2<<endl;
    if(t4<t7){
      t7=t3;
      p7=p3;
      t8=t4;
      p8=p4;
    }
    else if(t4<t8){
      if(t3<t7){
        t7=t3;
        p7=p3;
        t8=t4;
        p8=p4;
      }
      else{
        t8=t4;
        p8=p4;
      }
    }
    else if(t3<t7){
      t8=t7;
      p8=p7;
      t7=t3;
      p7=p3;
    }
    else if(t3<t8){
      t8=t3;
      p8=p3;
    }
  }
  cout<<p7<<" "<<t7<<endl;
  cout<<p8<<" "<<t8<<endl;
}