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<algorithm>
using namespace std;

#define MAX_N 8000
#define MAX_M 23994

pair<double, int>a[MAX_N]; 
pair<double, int>b[MAX_N]; 
pair<double, int>c[MAX_N];
pair<double, int>d[MAX_M];

void _cin(int p) {
	for (int i = 0; i < p; i++) {
		cin >> a[i].second >> a[i].first;
	}
	for (int i = 0; i < p; i++) {
		cin >> b[i].second >> b[i].first;
	}
	for (int i = 0; i < p; i++) {
		cin >> c[i].second >> c[i].first;
	}
}

void sort1(int p) {
	sort(a, a + p);
	sort(b, b + p);
	sort(c, c + p);
	for (int i = 0; i < 6; i++) {
		d[i].first = a[i + 2].first;
		d[i].second = a[i + 2].second;
	}
	for (int i = 0; i < 6; i++) {
		d[i + p - 2].first = b[i + 2].first;
		d[i + p - 2].second = b[i + 2].second;
	}
	for (int i = 0; i < 6; i++) {
		d[i + p + p - 4].first = c[i + 2].first;
		d[i + p + p - 4].second = c[i + 2].second;
	}
	sort(d, d + p * 3 - 6);
}

void print() {
	cout << a[0].second << ' ' << a[0].first << endl;
	cout << a[1].second << ' ' << a[1].first << endl;
	cout << b[0].second << ' ' << b[0].first << endl;
	cout << b[1].second << ' ' << b[1].first << endl;
	cout << c[0].second << ' ' << c[0].first << endl;
	cout << c[1].second << ' ' << c[1].first << endl;
	cout << d[0].second << ' ' << d[0].first << endl;
	cout << d[1].second << ' ' << d[1].first << endl;
}

int main() {
	_cin(8);
	sort1(8);
	print();
	return 0;
}

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

using namespace std;
typedef pair<double, int> P;

int main(void) {
  vector<P> v[3], loser;
  for (int i = 0; i < 3; i++) {
    v[i].resize(8);
    for (int j = 0; j < 8; j++) {
      cin >> v[i][j].second >> v[i][j].first;
    }
    sort(v[i].begin(), v[i].end());

    for (int j = 0; j < 2; j++) {
      printf("%d %.2f\n", v[i][j].second, v[i][j].first);
    }

    for (int j = 2; j < 8; j++) {
      loser.push_back(v[i][j]);
    }
  }

  sort(loser.begin(), loser.end());

  for (int i = 0; i < 2; i++) {
    printf("%d %.2f\n", loser[i].second, loser[i].first);
  }

  return 0;
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  int n = 24;
  vector<pair<double, int>> v(n);
  rep(i, n) cin >> v[i].se >> v[i].fi;
  vector<pair<double, int>>
    a(v.begin(), v.begin() + 8),
    b(v.begin() + 8, v.begin() + 16),
    c(v.begin() + 16, v.begin() + 24);
  sort(all(a)), sort(all(b)), sort(all(c)), sort(all(v));
  set<int> s;
  rep(i, 2) cout << a[i].se << ' ' << prec(2) << a[i].fi << endl, s.insert(a[i].se);
  rep(i, 2) cout << b[i].se << ' ' << prec(2) << b[i].fi << endl, s.insert(b[i].se);
  rep(i, 2) cout << c[i].se << ' ' << prec(2) << c[i].fi << endl, s.insert(c[i].se);
  for (int i = 0, t = 0; t < 2; i++) {
    if (s.count(v[i].se)) continue;
    cout << v[i].se << ' ' << prec(2) << v[i].fi << endl;
    t++;
  }
}

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

struct ply{int cl;int nu;int m;int s;int A;};

int main()
{

ply NUM[4][25],M1,M2,M3,T;
for(int ii=0;ii<4;ii++)
{
	
	for(int i=0;i<8;i++)
	{
		NUM[ii][i].cl=ii;
		scanf("%d %d.%d",&NUM[ii][i].nu,&NUM[ii][i].m,&NUM[ii][i].s);
		NUM[ii][i].A=100*NUM[ii][i].m+NUM[ii][i].s;
	}
	for(int i=0;i<8;i++)
		for(int j=7;j>i;j--)
			if(NUM[ii][i].A>NUM[ii][j].A)swap(NUM[ii][i],NUM[ii][j]);

}
M1=NUM[0][2];M2=NUM[1][2];M3=NUM[2][2];
if(M1.A<M2.A)swap(M1,M2);
if(M1.A<M3.A)swap(M1,M3);
if(M2.A<M3.A)swap(M2,M3);
for(int i=0;i<2;i++){
		for(int j=0;j<1;j++){
			if(NUM[i][j].s/10>0)cout<<NUM[i][j].nu<<" "<<NUM[i][j].m<<"."<<NUM[i][j].s<<endl;
			else if(NUM[i][j].s/10==0)cout<<NUM[i][j].nu<<" "<<NUM[i][j].m<<"."<<"0"<<NUM[i][j].s<<endl;
		}
}
if(M1.s/10>0)cout<<M1.nu<<" "<<M1.m<<"."<<M1.s<<endl;
else if(M1.s/10==0)cout<<M1.nu<<" "<<M1.m<<"."<<"0"<<M1.s<<endl;

if(M2.s/10>0)cout<<M2.nu<<" "<<M2.m<<"."<<M2.s<<endl;
else if(M2.s/10==0)cout<<M2.nu<<" "<<M2.m<<"."<<"0"<<M2.s<<endl;

return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

int main() {
  vector<pair<double,int> > vv;
  REP(k,3) {
    vector<pair<double,int> > v;
    REP(i,8) {
      int n;
      double t;
      cin >> n >> t;
      v.push_back(make_pair(t,n));
    }
    sort(ALL(v));
    REP(i,2)
      printf("%d %.2f\n",v[i].second,v[i].first);
    for(int i=2;i<8;i++)
      vv.push_back(v[i]);
  }
  sort(ALL(vv));
  REP(i,2)
    printf("%d %.2f\n",vv[i].second,vv[i].first);
}