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

struct man{
	int no;
	double time;
};

man p[24];
man hk[6];

void solve(){
	man tmp;
	for(int i=0; i<7; i++){
		if(p[i].time > p[i+1].time){
			tmp = p[i];
			p[i] = p[i+1];
			p[i+1] = tmp;
			i=-1;
		}
	}
	for(int i=8; i<15; i++){
		if(p[i].time > p[i+1].time){
			tmp = p[i];
			p[i] = p[i+1];
			p[i+1] = tmp;
			i=7;
		}
	}
	for(int i=16; i<23; i++){
		if(p[i].time > p[i+1].time){
			tmp = p[i];
			p[i] = p[i+1];
			p[i+1] = tmp;
			i=15;
		}
	}
	hk[0] = p[2];
	hk[1] = p[3];
	hk[2] = p[10];
	hk[3] = p[11];
	hk[4] = p[18];
	hk[5] = p[19];
	for(int i=0; i<5; i++){
		if(hk[i].time > hk[i+1].time){
			tmp = hk[i];
			hk[i] = hk[i+1];
			hk[i+1] = tmp;
			i=-1;
		}
	}
}

int main(){
	for(int i=0; i<24; i++)
		cin >> p[i].no >> p[i].time;
	solve();
	cout << p[0].no << ' ' << setprecision(2) << fixed << p[0].time << endl;
	cout << p[1].no << ' ' << setprecision(2) << fixed << p[1].time << endl;
	cout << p[8].no << ' ' << setprecision(2) << fixed << p[8].time << endl;
	cout << p[9].no << ' ' << setprecision(2) << fixed << p[9].time << endl;
	cout << p[16].no << ' ' << setprecision(2) << fixed << p[16].time << endl;
	cout << p[17].no << ' ' << setprecision(2) << fixed << p[17].time << endl;
	cout << hk[0].no << ' ' << setprecision(2) << fixed << hk[0].time << endl;
	cout << hk[1].no << ' ' << setprecision(2) << fixed << hk[1].time << endl;
}

C++: #include<iostream>
#include<iomanip>  
using namespace std;
struct player{
  int id;
  double time;
};
player pk[4];
player ph[2];
void top4(player a){
  if(a.time<pk[3].time||pk[3].time==0) pk[3] = a;
}
void top3(player a){
  top4(a);
  if(a.time<pk[2].time||pk[2].time==0){
    pk[3] = pk[2];
    pk[2] = a;
  }
}
void top2(player a){
  top3(a);
  if(a.time<pk[1].time||pk[1].time==0){
    pk[2] = pk[1];
    pk[1] = a;
  }
}
void top(player a){
  top2(a);
  if(a.time<pk[0].time||pk[0].time==0){
    pk[1] = pk[0];
    pk[0] = a;
  }
}
void phtop2(player a){
  if(a.time<ph[1].time||ph[1].time==0) ph[1] = a;
}
void phtop(player a){
  phtop2(a);
  if(a.time<ph[0].time||ph[0].time==0){
    ph[1] = ph[0];
    ph[0] = a;
  }
}
int main(){
  player p;
  for(int i=0;i<2;i++){
      ph[i].id = 0;
      ph[i].time = 0;
  }
  for(int i=0;i<3;i++){
    for(int i=0;i<4;i++){
      pk[i].id = 0;
      pk[i].time = 0;
    }
    for(int j=0;j<8;j++){
      cin >> p.id >> p.time;
      top(p);
    }
    cout << pk[0].id << ' ';
    cout << fixed << setprecision(2) << pk[0].time << endl;
    cout << pk[1].id << ' ';
    cout << fixed << setprecision(2) << pk[1].time << endl;
    phtop(pk[2]);
    phtop(pk[3]);
  }
  cout << ph[0].id << ' ';
  cout << fixed << setprecision(2) << ph[0].time << endl;
  cout << ph[1].id << ' ';
  cout << fixed << setprecision(2) << ph[1].time << endl;
  return 0;
}

C++: #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int main()
{
	map<int,double> m;

	rep(i,24)
	{
		int a;
		double b;
		cin >> a >> b;

		m[a] = b;
	}
	
	vector<pair<double,int> > v;
	vector<pair<double,int> > temp;
	REP(i,1,8)
	{
		v.push_back(make_pair(m[i],i));	
	}
	sort(v.begin(),v.end());
	
	cout << fixed;
	cout.precision(2);
	cout << v[0].second << " " << v[0].first << endl;
	cout << v[1].second << " " << v[1].first << endl;
	temp.push_back(v[2]);

	v.clear();
	REP(i,8,17)
	{
		v.push_back(make_pair(m[i],i));
	}
	sort(v.begin(),v.end());

	cout << v[0].second << " " << v[0].first << endl;
	cout << v[1].second << " " << v[1].first << endl;	
	temp.push_back(v[2]);

	v.clear();
	REP(i,17,25)
	{
		v.push_back(make_pair(m[i],i));
	}

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

	cout << v[0].second << " " << v[0].first << endl;
	cout << v[1].second << " " << v[1].first << endl;	
	temp.push_back(v[2]);
	
	sort(temp.begin(),temp.end());
	cout << temp[0].second << " " << temp[0].first << endl;
	cout << temp[1].second << " " << temp[1].first << endl;

	return 0;
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"


int main() {
	vector<pair< ld, int>>rests;
	cout << fixed << setprecision(2);
	for (int i = 0; i < 3; ++i) {
		vector<pair< ld,int>>ps;
		for (int j = 0; j < 8; ++j) {
			int a; ld b; cin >> a >> b;
			ps.emplace_back(b, a);
		}
		sort(ps.begin(), ps.end());
		for (int j = 0; j < 2; ++j) {
			
			cout << ps[j].second << " " << ps[j].first << endl;
		}
		for (int j = 2; j < 4; ++j) {
			rests.emplace_back(ps[j]);
		}
	}
	sort(rests.begin(), rests.end());
	for (int i = 0; i < 2; ++i) {
		cout << rests[i].second << " " << rests[i].first << endl;
	}
	return 0;
}