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 <fstream>
#include <typeinfo>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<25;
const double pi=acos(-1);
const double eps=1e-8;
const vi emp;

typedef vector<pair<double,int> > Vp;

Vp a;

int main(){
	cout<<syosu(2);
	int p;
	double t;
	for(int i=0;i<24;i++){
		cin>>p>>t;
		a.push_back(pair<double,int>(t,p));
	}
	sort(a.begin(),a.begin()+8);
	sort(a.begin()+8,a.begin()+16);
	sort(a.begin()+16,a.end());
	cout<<a[0].second<<' '<<a[0].first<<endl;
	cout<<a[1].second<<' '<<a[1].first<<endl;
	cout<<a[8].second<<' '<<a[8].first<<endl;
	cout<<a[9].second<<' '<<a[9].first<<endl;
	cout<<a[16].second<<' '<<a[16].first<<endl;
	cout<<a[17].second<<' '<<a[17].first<<endl;
	a.erase(a.begin(),a.begin()+2);
	a.erase(a.begin()+6,a.begin()+8);
	a.erase(a.begin()+12,a.begin()+14);
	sort(a.begin(),a.end());
	cout<<a[0].second<<' '<<a[0].first<<endl;
	cout<<a[1].second<<' '<<a[1].first<<endl;
}

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

int main() {
  pair<double, int> t[24];
  for (int i=0; i<24; i++) {
    cin >> t[i].second >> t[i].first;
  }
  for (int i=0; i<3; i++) {
    sort(t+8*i, t+8*(i+1));
    for (int j=0; j<2; j++) {
      cout << t[8*i+j].second << " " << fixed << setprecision(2) << t[8*i+j].first << endl;
      t[8*i+j].first = DBL_MAX;
    }
  }
  sort(t, t+24);
  for (int i=0; i<2; i++) {
    cout << t[i].second << " " << fixed << setprecision(2) << t[i].first << endl;
  }

  return 0;
}

C++: #include "bits/stdc++.h"

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back


int main(){
	vector<pair<double , int> > a,b,c,d;
	int x;
	double y;

	rep(i,8){
		cin>>x>>y;
		a.pb(make_pair(y,x));
	}
	rep(i,8){
		cin>>x>>y;
		b.pb(make_pair(y,x));
	}
	rep(i,8){
		cin>>x>>y;
		c.pb(make_pair(y,x));
	}

	sort(all(a));
	sort(all(b));
	sort(all(c));

	d.pb(a[2]);
	d.pb(b[2]);
	d.pb(c[2]);
	sort(all(d));
	rep(i,2)printf("%d %.2lf\n",a[i].second,a[i].first);
	rep(i,2)printf("%d %.2lf\n",b[i].second,b[i].first);
	rep(i,2)printf("%d %.2lf\n",c[i].second,c[i].first);
	rep(i,2)printf("%d %.2lf\n",d[i].second,d[i].first);
}

C++: #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <functional>

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

void solve()
{
	priority_queue<P, vector<P>, greater<P> > PQue;
	for(int i = 0; i < 3; ++i)
	{
		vector<P> Vec(8);
		for(int j = 0; j < 8; ++j)
		{
			cin >> Vec[j].second >> Vec[j].first;
		}
		sort(Vec.begin(), Vec.end());
		printf("%.2f %.2f\n", Vec[0].second, Vec[0].first);
		printf("%.2f %.2f\n", Vec[1].second, Vec[1].first);
		for(int i = 2; i < 8; ++i)
		{
			PQue.push(Vec[i]);
		}
	}
	printf("%.2f %.2f\n", PQue.top().second, PQue.top().first);
	PQue.pop();
	printf("%.2f %.2f\n", PQue.top().second, PQue.top().first);
}

int main()
{
	solve();
	return(0);
}

C++: #include <iostream>
#include <cstdio>
#include <map>
#define V map<float,int>::value_type
using namespace std;
int main()
{
  map<float,int> m[4];
  map<float,int>::iterator it;
  int i,j,k;
  float f;
  for(k=0;k<3;k++){
    for(i=0;i<8;i++){
      cin >> j >> f;
      m[k].insert( V(f,j) );
    }
  }
  for(k=0;k<3;k++){
    it = m[k].begin();
    for(i=0;i<2;i++){
      printf("%d %.2f\n",(*it).second, (*it).first);
      it++;
    }
    for(i=0;i<2;i++){
      m[3].insert(V((*it).first,(*it).second));
      it++;
    }
  }
  it = m[3].begin();
  for(i=0;i<2;i++){
    printf("%d %.2f\n",(*it).second, (*it).first);
    it++;
  }
  return 0;
}

C++: #include <iostream>
#include <queue>

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

void solve()
{
	priority_queue<P, vector<P>, greater<P> > PQue[3];
	for(int a = 0; a < 3; ++a)
	{
		for(int i = 0; i < 8; ++i)
		{
			P p;
			cin >> p.second >> p.first;
			PQue[a].push(p);
		}
	}
	for(int a = 0; a < 3; ++a)
	{
		for(int i = 0; i < 2; ++i)
		{
			printf("%d %.2f\n", PQue[a].top().second, PQue[a].top().first);
			PQue[a].pop();
		}
	}
	for(int a = 1; a < 3; ++a)
	{
		for(int i = 0; i < 2; ++i)
		{
			PQue[0].push(PQue[a].top());
			PQue[a].pop();
		}
	}
	for(int i = 0; i < 2; ++i)
	{
		printf("%d %.2f\n", PQue[0].top().second, PQue[0].top().first);
		PQue[0].pop();
	}

}

int main()
{
	solve();
	return(0);
}