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>
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",cnt,max,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",cnt3,y,cnt4,z);
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<pair<double,int>> finalist;
  vector<pair<double,int>> rest;
  rep(i,3){
    vector<pair<double,int>> list(8);
    rep(j,8){
      cin >> list[j].se >> list[j].fi;
    }
    sort(all(list));
    finalist.pb(list[0]);
    finalist.pb(list[1]);
    REP(i,2,8){
      rest.pb(list[i]);
    }
  }
  sort(all(rest));
  finalist.pb(rest[0]);
  finalist.pb(rest[1]);
  rep(i,8){
    fcout(2) << finalist[i].se << " " << finalist[i].fi<<endl;
  }
  return 0;
}

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

bool great( const pair<int,double>& left, const pair<int,double>& right ) {
    return left.second < right.second;
}

int main(){
	int n;
	double t;
	vector<pair<int,double> > v1,v2;
	for(int j = 0;j < 3;j++){
		for(int i = 0;i < 8;i++){
			cin >> n >> t;
			v1.push_back(make_pair(n,t));
		}
		sort(v1.begin(),v1.end(),great);
		printf("%d %.2f\n%d %.2f\n",v1[0].first,v1[0].second,v1[1].first,v1[1].second);
		for(int k = 2;k < 8;k++) v2.push_back(v1[k]);
		v1.clear();
	}
	sort(v2.begin(),v2.end(),great);
	printf("%d %.2f\n%d %.2f\n",v2[0].first,v2[0].second,v2[1].first,v2[1].second);
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

int main() {
  int num; double time;
  
  vector<pair<double, int> > last;
  
  { 
    vector<pair<double, int> > score(8);
    
    for(int i=0; i<8; i++) {
      cin >> num >> time;
      score[i] = make_pair(time, num);
    }
    sort(score.begin(), score.end());
    
    for(int i=0; i<2; i++) {
      printf("%d %.2f\n", score[i].second, score[i].first);
    }
    
    for(int i=2; i<8; i++) {
      last.push_back(score[i]);
    }
  }
  
  { 
    vector<pair<double, int> > score(8);
    
    for(int i=0; i<8; i++) {
      cin >> num >> time;
      score[i] = make_pair(time, num);
    }
    sort(score.begin(), score.end());
    
    for(int i=0; i<2; i++) {
      printf("%d %.2f\n", score[i].second, score[i].first);
    }
    
    for(int i=2; i<8; i++) {
      last.push_back(score[i]);
    }
  }
  
  { 
    vector<pair<double, int> > score(8);
    
    for(int i=0; i<8; i++) {
      cin >> num >> time;
      score[i] = make_pair(time, num);
    }
    sort(score.begin(), score.end());
    
    for(int i=0; i<2; i++) {
      printf("%d %.2f\n", score[i].second, score[i].first);
    }
    
    for(int i=2; i<8; i++) {
      last.push_back(score[i]);
    }
  }
  
  sort(last.begin(), last.end());
  
  for(int i=0; i<2; i++) {
    printf("%d %.2f\n", last[i].second, last[i].first);
  }
  
  return 0;
}

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

typedef struct P {
	int n;
	double p;
	bool operator<(const P &r) {
		return p < r.p;
	}
} P;
P p[24];


int main(){
	for (int i = 0; i < 24; i++) {
		cin >> p[i].n >> p[i].p;
	}
	sort(p, p + 8);
	sort(p + 8, p + 16);
	sort(p + 16, p + 24);
	for (int i = 0; i < 3; i++) {
		cout << p[8 * i].n << " " << p[8 * i].p << endl << p[8 * i + 1].n << " " << p[8 * i + 1].p << endl;
	}
	P a[3] = { p[2],p[10],p[18] };
	sort(a, a + 3);
	cout << a[0].n << " " << a[0].p << endl << a[1].n << " " << a[1].p << endl;

	return 0;
}