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<cstring>
#include<algorithm>
#include<string>
#include<iomanip>
#include<vector>
#include<cstdio>
#include<cmath>
#define pb(in,tmp) in.push_back(tmp)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) loop(i,0,b)
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
using namespace std;
int main(){
  double m[2]={100};
  int n[2]={0};
  rep(i,3){
    vector<int>a(8);
	vector<double>b(8);
	rep(j,8)cin>>a[j]>>b[j];
	rep(j,7){
	  rep(k,7-j){
	    if(b[k]>b[k+1]){
		  swap(b[k],b[k+1]);
		  swap(a[k],a[k+1]);
		}
      }
	}
    //cout<<b[2]<<"!"<<b[3]<<endl;
	rep(j,2)printf("%d %.2f\n",a[j],b[j]);
	rep(k,2){
	  rep(j,2){
     	if(m[k]>b[j+2]){
		  if(k==0){
		    m[1]=m[0];
			n[1]=n[0];
		  }
	      m[k]=b[j+2];
	      n[k]=a[j+2];
		  b[j+2]=100;
		}
	  }
	}
	//rep(i,2)cout<<n[i]<<" "<<m[i]<<endl;
  }
  rep(i,2)printf("%d %.2f\n",n[i],m[i]);
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <math.h>
#include <functional>
#include <algorithm>
#include <utility>
#include <iomanip>

typedef long long Int;
#define REP(i,n) for(int i = 0 ; i < n ; ++i)
#define REPS(a,i,n) for(int i = a ; i < n ; ++i)
using namespace std;

vector<pair<double, int >>kumi1;
vector<pair<double, int >>kumi2;
vector<pair<double, int >>kumi3;

int main(){

	REP(i, 8){
		pair<double, int>tmp;
		cin >> tmp.second;
		cin >> tmp.first;
		kumi1.push_back(tmp);
	}
	REP(i, 8){
		pair<double, int>tmp;
		cin >> tmp.second;
		cin >> tmp.first;
		kumi2.push_back(tmp);
	}
	REP(i, 8){
		pair<double, int>tmp;
		cin >> tmp.second;
		cin >> tmp.first;
		kumi3.push_back(tmp);
	}

	sort(kumi1.begin(), kumi1.end());
	sort(kumi2.begin(), kumi2.end());
	sort(kumi3.begin(), kumi3.end());

	cout << fixed << setprecision(2) << kumi1[0].second << " " << kumi1[0].first << endl << kumi1[1].second << " " << kumi1[1].first << endl;
	kumi1.erase(kumi1.begin());
	kumi1.erase(kumi1.begin());
	cout << fixed << setprecision(2) << kumi2[0].second << " " << kumi2[0].first << endl << kumi2[1].second << " " << kumi2[1].first << endl;
	kumi2.erase(kumi2.begin());
	kumi2.erase(kumi2.begin());
	cout << fixed << setprecision(2) << kumi3[0].second << " " << kumi3[0].first << endl << kumi3[1].second << " " << kumi3[1].first << endl;
	kumi3.erase(kumi3.begin());
	kumi3.erase(kumi3.begin());

	auto aa = kumi1.begin();
	auto bb = kumi2.begin();
	auto cc = kumi3.begin();

	if (*aa < *bb){
		if (*aa < *cc){
			cout << fixed << setprecision(2) << aa->second << " " << aa->first << endl;
			kumi1.erase(aa);
		}
		else
		if (*aa > *cc){
			cout << fixed << setprecision(2) << cc->second << " " << cc->first << endl;
			kumi3.erase(cc);
		}
	}
	else{
		if (*bb < *cc){
			cout << fixed << setprecision(2) << bb->second << " " << bb->first << endl;
			kumi2.erase(bb);
		}
		else
		if (*bb > *cc){
			cout << fixed << setprecision(2) << cc->second << " " << cc->first << endl;
			kumi3.erase(cc);
		}

	}
	////////

	aa = kumi1.begin();
	bb = kumi2.begin();
	cc = kumi3.begin();

	if (*aa < *bb){
		if (*aa < *cc){
			cout << fixed << setprecision(2) << aa->second << " " << aa->first << endl;
			kumi1.erase(aa);
		}
		else
		if (*aa > *cc){
			cout << fixed << setprecision(2) << cc->second << " " << cc->first << endl;
			kumi3.erase(cc);
		}
	}
	else{
		if (*bb < *cc){
			cout << fixed << setprecision(2) << bb->second << " " << bb->first << endl;
			kumi2.erase(bb);
		}
		else
		if (*bb > *cc){
			cout << fixed << setprecision(2) << cc->second << " " << cc->first << endl;
			kumi3.erase(cc);
		}

	}

	return 0;
}

C++: #include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
	map<double, int> n_t;
	int num;
	double t;
	vector<double> rank, all;
	for( int r = 0; r < 3; r++ ){
		for( int i = 0; i < 8; i++ ){
			cin >> num >> t;
			n_t[t] = num;
			rank.push_back(t);
		}
		sort(rank.begin(), rank.end());
		vector<double>::iterator it = rank.begin();
		cout << n_t[*it] << ' ' << *it << endl;
		//rank.erace(it);
		it++;
		cout << n_t[*it] << ' ' << *it << endl;
		it++;
		for( ; it != rank.end(); it++ ){
			all.push_back(*it);
		}
		rank.clear();
	}
	sort(all.begin(), all.end());
	vector<double>::iterator it = all.begin();
	cout << n_t[*it] << ' ' << *it << endl;
	it++;
	cout << n_t[*it] << ' ' << *it << endl;

	return 0;
}