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

typedef pair<double, int> PINT;

int main() {
  vector<PINT> v;
  double n1;
  int n2;

  for(int j = 0; j < 3; j++) {
    for(int i = 0; i < 8; i++) {
      cin >> n2 >> n1;
      v.push_back(make_pair(n1, n2));
    }
    
    sort(v.begin() + j*8, v.end());
    cout << v[j*8].second << " " << v[j*8].first << endl; v[j*8].first = 10000000.0;
    cout << v[j*8+1].second << " " << v[j*8+1].first << endl; v[j*8+1].first = 10000000.0;
  }

  sort(v.begin(), v.end());
  printf("%d %.2f\n", v[0].second, v[0].first);
  printf("%d %.2f\n", v[1].second, v[1].first);

  return 0;
}

C++: # define _CRT_SECURE_NO_WARNINGS 1
# include <iostream>
# include <numeric>
# include <string>
# include <bitset>
# include <vector>
# include <algorithm>
# include <cstdlib>
# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iomanip>
# include <queue>
# include <sstream>
# include <climits>
# include <cmath>
# include <list>
# include <functional>
# include <string>
# include <ctime>
# include <set>
# include <forward_list>
# include <map>
# include <stack>
using namespace std;

# define INF ((int)(1<<30))
# define REP(i,n) for(int i=0;i<(int)n;i++)
# define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)
# define TORAD 2.0*M_PI/360.0
# define INT(x) int x;cin>>x;
# define ALL(x) (x).begin(),(x).end()
# define RALL(x) (x).rbegin(),(x).rend()
# define DEBUG(x) cout<<#x<<" :"<<x<<endl;
# define EPS 1e-12

template<class T> void debug(T a) { for (auto i : a)cout << i << endl; }

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
int dx[4] = { 0,-1,1,0 }, dy[4] = { 1,0,0,-1 };

int main()
{
	typedef pair<double,int> p;
	vector<p> a[3],ans,t;
	REP(i, 3)
	{
		REP(j, 8)
		{
			p x; cin >> x.second >> x.first;
			a[i].push_back(x);
		}
		sort(ALL(a[i]));
		ans.push_back(a[i][0]);
		ans.push_back(a[i][1]);
		for (int j = 2; j < 8; j++)
		{
			t.push_back(a[i][j]);
		}
	}
	sort(ALL(t));
	ans.push_back(t[0]); ans.push_back(t[1]);
	for (int i = 0; i < ans.size(); i++)
	{
		cout << ans[i].second << " " << ans[i].first << endl;
	}


}

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

struct record{
	int num;
	double time;
};

bool operator<(const record& a, const record& b){
	return a.time < b.time;
}

int main(void){
	vector<record> rec1;
	vector<record> rec2;
	vector<record> rec3;
	vector<record> allrec;
	int i;
	record allbuf;
	
	for(i = 0; i < 8; i++){
		record buf;
		cin >>buf.num >>buf.time;
		rec1.push_back(buf);
	}
	sort(rec1.begin(), rec1.end());
	
	for(i = 0; i < 8; i++){
		record buf;
		cin >>buf.num >>buf.time;
		rec2.push_back(buf);
	}
	sort(rec2.begin(), rec2.end());
	
	for(i = 0; i < 8; i++){
		record buf;
		cin >>buf.num >>buf.time;
		rec3.push_back(buf);
	}
	sort(rec3.begin(), rec3.end());
	
	printf("%d %.2f\n", rec1[0].num, rec1[0].time);
	printf("%d %.2f\n", rec1[1].num, rec1[1].time);
	printf("%d %.2f\n", rec2[0].num, rec2[0].time);
	printf("%d %.2f\n", rec2[1].num, rec2[1].time);
	printf("%d %.2f\n", rec3[0].num, rec3[0].time);
	printf("%d %.2f\n", rec3[1].num, rec3[1].time);
	
	for(i = 2; i < 8; i++){
		allbuf = rec1[i];
		allrec.push_back(allbuf);
	}
	for(i = 2; i < 8; i++){
		allbuf = rec2[i];
		allrec.push_back(allbuf);
	}
	for(i = 2; i < 8; i++){
		allbuf = rec3[i];
		allrec.push_back(allbuf);
	}
	sort(allrec.begin(), allrec.end());
	
	printf("%d %.2f\n", allrec[0].num, allrec[0].time);
	printf("%d %.2f\n", allrec[1].num, allrec[1].time);
	
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
#include <sstream>
#include <cstdio>
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)
#define pb push_back
#define mp make_pair
int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

vector<pair<double,int> > other;
int main(void){
  rep(i,3){
    vector<pair<double,int> > timer;
    rep(i,8){
      int n;double t;
      cin>>n>>t;
      timer.pb(mp(t,n));
    }
    sort(all(timer));
    rep(i,2)
      printf("%d %.2f\n",timer[i].second,timer[i].first);
    loop(i,2,timer.size()){
      other.push_back(timer[i]);
    }
    timer.clear();
  }
  sort(all(other));
    rep(i,2)
      printf("%d %.2f\n",other[i].second,other[i].first);

}