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<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main(){
    int undern[2];
    double under[2]={999999,999999};
    for(int a = 0; a < 3; a++){
        double place[4] = {999999,999999,999999,999999};
        int    placen[4] = {999999,999999,999999,999999};
        for(int b = 0; b < 8; b++){
            int n;double t;
            cin >> n >> t;
            if(t < place[0]){
                swap(placen[0],n);
                swap(place[0],t);
            }
            if(t < place[1]){
                swap(placen[1],n);
                swap(place[1],t);
            }
            if(t < place[2]){
                swap(placen[2],n);
                swap(place[2],t);
            }
            if(t < place[3]){
                place[3] = t;
                placen[3] = n;
            }
        }
        cout << fixed << setprecision(2) << placen[0] << ' ' << place[0] << endl;
        cout << fixed << setprecision(2) << placen[1] << ' ' << place[1] << endl;
        if(place[2] < under[0]){
            swap(place[2],under[0]);
            swap(placen[2],undern[0]);
        }
        if(place[2] < under[1]){
            swap(place[2],under[1]);
            swap(placen[2],undern[1]);
        }
        if(place[3] < under[0]){
            swap(place[3],under[0]);
            swap(placen[3],undern[0]);
        }
        if(place[3] < under[1]){
            swap(place[3],under[1]);
            swap(placen[3],undern[1]);
        }
    }
    cout << fixed << setprecision(2) << undern[0] << ' ' << under[0] << endl;
    cout << fixed << setprecision(2) << undern[1] << ' ' << under[1] << endl;
    return 0;
}

C++: #include <stdio.h>
#include <algorithm>
using namespace std;
pair<double, int> p1[8], p2[8], p3[8], p4[24];
int main() {
	for(int i = 0; i < 8; i++) scanf("%d %lf", &p1[i].second, &p1[i].first), p4[i] = p1[i]; sort(p1, p1 + 8);
	for(int i = 0; i < 8; i++) scanf("%d %lf", &p2[i].second, &p2[i].first), p4[i + 8] = p2[i]; sort(p2, p2 + 8);
	for(int i = 0; i < 8; i++) scanf("%d %lf", &p3[i].second, &p3[i].first), p4[i + 16] = p3[i]; sort(p3, p3 + 8);
	printf("%d %lf\n%d %lf\n", p1[0].second, p1[0].first, p1[1].second, p1[1].first);
	printf("%d %lf\n%d %lf\n", p2[0].second, p2[0].first, p2[1].second, p2[1].first);
	printf("%d %lf\n%d %lf\n", p3[0].second, p3[0].first, p3[1].second, p3[1].first);
	sort(p4, p4 + 24);
	for(int i = 0, c = 0; c < 5; i++) {
		int s = p4[i].second; bool flag = true;
		flag = flag && (s != p1[0].second && s != p2[0].second && s != p3[0].second);
		flag = flag && (s != p1[1].second && s != p2[1].second && s != p3[1].second);
		if(flag) printf("%d %lf\n", p4[i].second, p4[i].first), c++;
	}
	return 0;
}

C++: #include<stdio.h>
#include<algorithm>
using namespace std;
pair<double,int> dat[24];
int main(){
	for(int i=0;i<24;i++)scanf("%d%lf",&dat[i].second,&dat[i].first);
	sort(dat,dat+8);
	printf("%d %.2lf\n%d %.2lf\n",dat[0].second,dat[0].first,dat[1].second,dat[1].first);
	sort(dat+8,dat+16);
	printf("%d %.2lf\n%d %.2lf\n",dat[8].second,dat[8].first,dat[9].second,dat[9].first);
	sort(dat+16,dat+24);
	printf("%d %.2lf\n%d %.2lf\n",dat[16].second,dat[16].first,dat[17].second,dat[17].first);
	dat[0]=dat[18];
	dat[1]=dat[19];
	dat[8]=dat[20];
	dat[9]=dat[21];
	dat[16]=dat[22];
	dat[17]=dat[23];
	sort(dat,dat+18);
	printf("%d %.2lf\n%d %.2lf\n",dat[0].second,dat[0].first,dat[1].second,dat[1].first);
}

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

using namespace std;
using ll = long long;
using pii = pair<int, int>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(2);
  
  using P = pair<int, double>;
  vector<P> g[4];
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 8; j++) {
      int p;
      double t;
      cin >> p >> t;
      g[i].emplace_back(p, t);
    }
    sort(g[i].begin(), g[i].end(), [&](P a, P b) {
      return a.second < b.second;
    });
    for (int j = 2; j < 8; j++) {
      g[3].emplace_back(g[i][j]);
    }
  }
  sort(g[3].begin(), g[3].end(), [&](P a, P b) {
    return a.second < b.second;
  });
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 2; j++) {
      cout << g[i][j].first << " " << g[i][j].second << endl;
    }
  }

  return 0;
}

C++: #include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <cstring>
#include <deque>
#include <cstdio>
#include <cmath>

using namespace std;

#define reep(i,f,t) for(int i=f ; i<int(t) ; ++i)
#define rep(i,n) reep(i, 0, n) 

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int main()
{
	pair<double, int> result[3][8];
	rep(i, 3){
		rep(j, 8)
			scanf("%d%lf", &result[i][j].second, &result[i][j].first);
		sort(result[i], result[i]+8);
		rep(j, 2){
			printf("%d %.2f\n", result[i][j].second, result[i][j].first);
			result[i][j].first = 1000000.0;
		}
	}
	
	sort(&result[0][0], &result[0][0]+24);
	rep(i, 2)
		printf("%d %.2f\n", result[0][i].second, result[0][i].first);
	return 0;
}

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

int main(){
	map<int,double> t;
	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<(int)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] );
		}
	}
}