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++: /*
	Track and field Competition
*/
#include	<iostream>
#include	<cstdio>
#include	<vector>
#include	<utility>
#include	<algorithm>
#include	<functional>

using namespace std;

typedef pair<double, int> P_DI;

int main(void) {
	vector<P_DI> Group1, Group2, Group3, GroupMod;
	int buff_sc, c;
	double buff_tm;
	
	for(int i = 0; i < 8; i++) {
		cin >> buff_sc >> buff_tm;
		Group1.push_back( P_DI(buff_tm, buff_sc) );
	}
	for(int i = 0; i < 8; i++) {
		cin >> buff_sc >> buff_tm;
		Group2.push_back( P_DI(buff_tm, buff_sc) );
	}
	for(int i = 0; i < 8; i++) {
		cin >> buff_sc >> buff_tm;
		Group3.push_back( P_DI(buff_tm, buff_sc) );
	}
	sort(Group1.begin(), Group1.end());
	sort(Group2.begin(), Group2.end());
	sort(Group3.begin(), Group3.end());
	
	c = 1;
	vector<P_DI>::iterator it = Group1.begin();
	while(it != Group1.end()) {
		if(c < 3) {
			printf("%d %5.2f\n", (*it).second, (*it).first);
		} else {
			GroupMod.push_back( P_DI((*it).first, (*it).second) );
		}
		c++;
		it++;
	}
	c = 1;
	it = Group2.begin();
	while(it != Group2.end()) {
		if(c < 3) {
			printf("%d %5.2f\n", (*it).second, (*it).first);
		} else {
			GroupMod.push_back( P_DI((*it).first, (*it).second) );
		}
		c++;
		it++;
	}
	c = 1;
	it = Group3.begin();
	while(it != Group3.end()) {
		if(c < 3) {
			printf("%d %5.2f\n", (*it).second, (*it).first);
		} else {
			GroupMod.push_back( P_DI((*it).first, (*it).second) );
		}
		c++;
		it++;
	}
	
	sort(GroupMod.begin(), GroupMod.end());
	it = GroupMod.begin();
	for(int i = 0; i < 2; i++) {
		printf("%d %5.2f\n", (*it).second, (*it).first);
		it++;
	}
}

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

int main() {
    map<double, int> players[3];
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 8; j++) {
            int num;
            double time;
            cin >> num >> time;
            players[i].insert(make_pair(time, num));
        }
    }
    map<double, int> notWinPlayers;
    for (int i = 0; i < 3; i++) {
        map<double, int>::iterator it = players[i].begin();
        printf("%d %.2f\n", it->second, it->first);
        it++;
        printf("%d %.2f\n", it->second, it->first);
        it++;
        for ( ; it != players[i].end(); it++) {
            notWinPlayers.insert(make_pair(it->first, it->second));
        }
    }
    int count = 0;
    for (map<double, int>::iterator it = notWinPlayers.begin(); count < 2; it++, count++) {
        printf("%d %.2f\n", it->second, it->first);
    }
}

C++: #include<cstdio>
#include<vector>
#include<algorithm>
#include<functional>
using namespace std;
typedef pair<double,int>P;
int main(){
    P s[3][8];
    for(int i=0;i<3;i++){
        for(int j=0;j<8;j++){
            double v;
            int p;
            scanf("%d%lf",&p,&v);
            s[i][j]=P(v,p);
        }
    }
    for(int i=0;i<3;i++)sort(s[i],s[i]+8);
    P t[6];
    for(int i=0;i<3;i++){
        for(int j=0;j<2;j++){
            printf("%d %.2f\n",s[i][j].second,s[i][j].first);
            t[i*2+j]=s[i][j+2];
        }
    }
    sort(t,t+6);
    for(int i=0;i<2;i++){
        printf("%d %.2f\n",t[i].second,t[i].first);
    }
    return 0;
}

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

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define LOOP(i) while(i--)
#define PRINTALL(c) for(auto pitr=c.begin();pitr!=c.end();++pitr){cout<<*pitr;if(next(pitr,1)!=c.end())cout<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

class Data{
public:
	int first;
	double second;
	string third;
};

int main(){
	//cin.tie(0);
	//ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);

	deque<Data> P1(8),P2(8),P3(8),P;
	REP(i,8){
		P1[i].first=in(),P1[i].third=in<string>();
	}
	REP(i,8){
		P2[i].first=in(),P2[i].third=in<string>();
	}
	REP(i,8){
		P3[i].first=in(),P3[i].third=in<string>();
	}

	auto comp = [](Data& l,Data& r){return l.third<r.third;};
	sort(ALL(P1),comp);
	sort(ALL(P2),comp);
	sort(ALL(P3),comp);
	
	REP(i,2){
		out(P1[0].first,P1[0].third);
		P1.pop_front();
	}
	REP(i,2){
		out(P2[0].first,P2[0].third);
		P2.pop_front();
	}
	REP(i,2){
		out(P3[0].first,P3[0].third);
		P3.pop_front();
	}
	copy(ALL(P1),back_inserter(P));
	copy(ALL(P2),back_inserter(P));
	copy(ALL(P3),back_inserter(P));
	sort(ALL(P),comp);

	REP(i,2){
		out(P[0].first,P[0].third);
		P.pop_front();
	}
	return 0;
}