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++: #define	_USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <string>
#include <set>
using namespace std;
int main(){
	
	map<double,string> s;
	vector<double> t1(8);
	vector<double> t2(8);
	vector<double> t3(8);
	vector<double> t4;
	for(int i=0;i<8;i++){
		string a;
		cin>>a>>t1[i];
		s[t1[i]]=a;
	}
	for(int i=0;i<8;i++){
		string a;
		cin>>a>>t2[i];
		s[t2[i]]=a;
	}
	for(int i=0;i<8;i++){
		string a;
		cin>>a>>t3[i];
		s[t3[i]]=a;
	}
	
	
	sort(t1.begin(),t1.end());
	sort(t2.begin(),t2.end());
	sort(t3.begin(),t3.end());
	
	for(int i=2;i<8;i++){
		t4.push_back(t1[i]);
		t4.push_back(t2[i]);
		t4.push_back(t3[i]);
	}
	sort(t4.begin(),t4.end());
	
	
	cout<<s[t1[0]]<<" "<<t1[0]<<endl;
	cout<<s[t1[1]]<<" "<<t1[1]<<endl;
	cout<<s[t2[0]]<<" "<<t2[0]<<endl;
	cout<<s[t2[1]]<<" "<<t2[1]<<endl;
	cout<<s[t3[0]]<<" "<<t3[0]<<endl;
	cout<<s[t3[1]]<<" "<<t3[1]<<endl; 
	cout<<s[t4[0]]<<" "<<t4[0]<<endl;
	cout<<s[t4[1]]<<" "<<t4[1]<<endl;
	
	
	
	
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main() {
	typedef pair<double, int> p;
	p a[9], b[9], c[9], d[20];
	for (int i = 0; i < 8; i++)cin >> a[i].second >> a[i].first;
	for (int i = 0; i < 8; i++)cin >> b[i].second >> b[i].first;
	for (int i = 0; i < 8; i++)cin >> c[i].second >> c[i].first;
	sort(a, a + 8); sort(b, b + 8); sort(c, c + 8);
	int k = 0;
	for (int i = 2; i < 4; i++) {
		d[k] = a[i]; k++;
		d[k] = b[i]; k++;
		d[k] = c[i]; k++;
	}
	sort(d, d + 6);
	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;
	char ch; cin >> ch;
}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pii;

int main(){
	pair<double,int> a[8],b[6];
	int c=0;
	rep(i,0,3){
		rep(j,0,8) cin>>a[j].se>>a[j].fi;
		sort(a,a+8);
		rep(j,0,2) printf("%d %.2lf\n",a[j].se,a[j].fi);
		rep(j,0,2){
			b[2*i+j].fi=a[2+j].fi;
			b[2*i+j].se=a[2+j].se;
		}
	}
	sort(b,b+6);
	rep(i,0,2) printf("%d %.2lf\n",b[i].se,b[i].fi);;
}

C++: #include<string>
#include<iostream>
#include<map>
using namespace std;
int main() {
	map<double, int>d;
	for (int i = 0; i < 3; i++) {
		map<double, int>a;
		int b;
		double c;
		for (int j = 0; j < 8; j++) {
			cin >> b >> c;
			a.insert(map<double, int>::value_type(c, b));
		}
		map<double, int>::iterator it = a.begin();
		cout << (*it).second << " " << (*it).first << endl;
		it++;
		cout << (*it).second << " " << (*it).first << endl;
		it++;
		d.insert(map<double, int>::value_type((*it).second, (*it).first));
	}
	map<double, int>::iterator it = d.begin();
	cout << (*it).second << " " << (*it).first << endl;
	it++;
	cout << (*it).second << " " << (*it).first << endl;
	it++;
}

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

int sn[24];
double st[24];

void top(int s,int e){
	int i,j;
	double m=99999;
	for (i=s;i<e;i++) if (m>st[i]) { m=st[i]; j=i; }
	cout << sn[j] << ' ' << m << endl;
	st[j]=99999;
}

int main() {
	int i,j;
	for (i=0;i<24;i++) cin >> sn[i] >> st[i];
    for (i=0;i<3;i++) for (j=0;j<2;j++) top(i*8,i*8+7);
	top(0,23); top(0,23);
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>
#include <iterator>
 
using namespace std;
 
typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
 
#define FOR(i,n) for(int i = 0; i < (n); i++)

typedef unsigned long long ull;

int main(){
	const int n = 3,m = 8;
	vector<pair<double,int>> v;
	FOR(i,n){
		pair<double,int> x[m];
		FOR(i,m) cin>>x[i].second >> x[i].first;
		sort(x,x+m);
		FOR(i,2) printf("%d %.2lf\n",x[i].second,x[i].first);
		v.insert(v.end(),x+2,x+m);
	}

	sort(v.begin(),v.end());
	FOR(i,2) printf("%d %.2lf\n",v[i].second,v[i].first);

	return 0;
}