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<cstdio>
#include<algorithm>
using namespace std;
int main(){

  int a[25];
  double b[25];
  
  for(int i=0;i<24;i++){
    scanf("%d %lf",&a[i],&b[i]);
  }

  for(int k=8;k<=24;k+=8){
    
    for(int i=k-8;i<k-1;i++){
      for(int j=i+1;j<k;j++){
	if(b[i] > b[j]){
	  swap(a[i],a[j]);
	  swap(b[i],b[j]);
	}
      }
    }

  }
  
  for(int i=0;i<=16;i+=8){
    printf("%d %g\n%d %g\n",a[i],b[i],a[i+1],b[i+1]);
  }
  
  if(b[2] < b[10] && b[2] < b[18]){
    printf("%d %g\n",a[2],b[2]);
    if(b[10] < b[18]) printf("%d %g\n",a[10],b[10]);
    else printf("%d %g\n",a[18],b[18]);
  }
  else if(b[10] < b[2] && b[10] < b[18]){
    printf("%d %g\n",a[10],b[10]);
    if(b[2] < b[18]) printf("%d %g\n",a[2],b[2]);
    else printf("%d %g\n",a[18],b[18]);
  }
  else if(b[18] < b[2] && b[18] < b[10]){
    printf("%d %g\n",a[18],b[18]);
    if(b[2] < b[10]) printf("%d %g\n",a[2],b[2]);
    else printf("%d %g\n",a[10],b[10]);
  }
  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()
{
	vector<pair<double,int> > v,v1,v2,temp;
	int a;
	double b;
	
	rep(i,8)
	{
		cin >> a >> b;
		v.push_back(make_pair(b,a));
	}

	rep(i,8)
	{
		cin >> a >> b;
		v1.push_back(make_pair(b,a));
	}

	rep(i,8)
	{
		cin >> a >> b;
		v2.push_back(make_pair(b,a));
	}

	sort(v.begin(),v.end());
	sort(v1.begin(),v1.end());
	sort(v2.begin(),v2.end());
	
	cout << fixed;
	cout.precision(2);

	REP(i,2,4)
	{
		temp.push_back(v[i]);
		temp.push_back(v1[i]);
		temp.push_back(v2[i]);
	}

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

	rep(i,2) cout << v[i].second << " " << v[i].first << endl;
	rep(i,2) cout << v1[i].second << " " << v1[i].first << endl;
	rep(i,2) cout << v2[i].second << "  "<< v2[i].first << endl;
	rep(i,2) cout << temp[i].second << " " <<temp[i].first << endl;
	return 0;
}

C++: #include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	int fn, sn, tn, t1n, t2n, a;
	float ft, st, tt, t1t, t2t, b;
	
	t1t = t2t = 100;
	t1n = t2n = 0;
	for(int i = 0; i < 3; i++){
		fn = sn = tn = 0;
		ft = st = tt = 1000;
		for(int j = 0; j < 8; j++){
			cin >> a >> b;
			if(b < ft){
				tt = st;
				tn = sn;
				st = ft;
				sn = fn;
				ft = b;
				fn = a;
			} else if(b < st){
				tt = st;
				tn = sn;
				st = b;
				sn = a;
			} else if(b < tt){
				tt = b;
				tn = a;
			}
		}
		cout << fn << " " << ft << endl;
		cout << sn << " " << st << endl;
		if(tt < t1t){
			t2t = t1t;
			t2n = t1n;
			t1t = tt;
			t1n = tn;
		} else if(tt < t2t){
			t2t = tt;
			t2n = tn;
		}
	}
	cout << t1n << " " << t1t << endl;
	cout << t2n << " " << t2t << 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]);
	temp.push_back(v[3]);

	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]);
	temp.push_back(v[3]);
	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]);
	temp.push_back(v[3]);

	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 <cstdio>
#include <algorithm>
#include <vector>
using namespace std;

int main(){
  int i=0,j,x;
  float f;
  vector<pair<float,int> >v,w;
  for(;i<3;i++){
    for(j=0;j<8;j++)
      scanf("%d%f",&x,&f),v.push_back(make_pair(f,x));
    sort(v.begin(),v.end());
    printf("%d %.2f\n%d %.2f\n",v[0].second,v[0].first,v[1].second,v[1].first);
    w.push_back(make_pair(v[2].first,v[2].second));
    w.push_back(make_pair(v[3].first,v[3].second));
    v.clear();
  }
  sort(w.begin(),w.end());
  printf("%d %.2f\n%d %.2f\n",w[0].second,w[0].first,w[1].second,w[1].first);
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
struct {int n; double t;} p[3][8], x, q[18];
int main()
{
	int i, j, k;
	for (i = 0; i < 3; i++)
	{
		for (j = 0; j < 8; j++)
			cin >> p[i][j].n >> p[i][j].t;
		for (j = 0; j < 8; j++)
			for (k = 0; k < 7; k++)
				if (p[i][k].t > p[i][k+1].t)
				{
					x = p[i][k];
					p[i][k] = p[i][k+1];
					p[i][k+1] = x;
				}
	}
	for (i = 0; i < 3; i++)
	{
		for (j = 0; j < 2; j++)
			printf("%d %.2f\n", p[i][j].n, p[i][j].t);
		for (j = 2; j < 8; j++)
			q[i*6+j-2] = p[i][j];
	}
	for (i = 0; i < 18; i++)
		for (j = 0; j < 17; j++)
			if (q[j].t > q[j+1].t)
			{
				x = q[j];
				q[j] = q[j+1];
				q[j+1] = x;
			}
	for (i = 0; i < 2; i++)
		printf("%d %.2f\n", q[i].n, q[i].t);
}

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

int main() {
  vector<pair<double,string> > V[3], U;
  for(int i = 0; i < 24; ++i) {
    pair<double,string> p;
    cin >> p.second >> p.first;
    V[i/8].push_back(p);
  }
  for(int k = 0; k < 3; ++k) {
    sort(V[k].begin(), V[k].end());
    for(int j = 2; j < V[k].size(); ++j) {
      U.push_back(V[k][j]);
    }
  }
  sort(U.begin(), U.end());
  for(int k = 0; k < 3; ++k) {
    for(int j = 0; j < 2; ++j) {
      printf("%s %.2f\n", V[k][j].second.c_str(), V[k][j].first);
    }
  }
  for(int j = 0; j < 2; ++j) {
    printf("%s %.2f\n", U[j].second.c_str(), U[j].first);
  }
  return 0;
}