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<cstdio>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<list>
#include<stack>
#include<queue>
#include<cctype>
#include<iomanip>
#include<functional>
#include<numeric>
#include<map>
#include<set>
#include<complex>
#define EPS 1e-10
using namespace std;
typedef long long llong;
bool f(pair<int, double>a, pair<int, double>b) {
	return a.second < b.second;
}
int main() {
	vector<pair<int, double> >v(24);
	for (int i = 0; i < 24; i++) {
		cin >> v[i].first >> v[i].second;
	}
	//cout << endl << endl;
	//cout << setprecision(4);
	sort(v.begin(), v.begin() + 8, f);
	cout << v[0].first << " " << v[0].second << endl;
	cout << v[1].first << " " << v[1].second << endl;

	sort(v.begin() + 8, v.begin() + 8 + 8, f);
	cout << v[8].first << " " << v[8].second << endl;
	cout << v[9].first << " " << v[9].second << endl;

	sort(v.begin() + 8 + 8, v.end(), f);
	cout << v[16].first << " " << v[16].second << endl;
	cout << v[17].first << " " << v[17].second << endl;

	v.erase(v.begin() + 8 + 8, v.begin() + 8 + 8 + 2);
	v.erase(v.begin() + 8, v.begin() + 8 + 2);
	v.erase(v.begin(), v.begin() + 2);

	sort(v.begin(), v.end(), f);
	cout << v[0].first << " " << v[0].second << endl;
	cout << v[1].first << " " << v[1].second << endl;

	return 0;
}

C++: #include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstdio>
#define EPS 1e-10
#define F first
#define S second
using namespace std;
typedef pair<int,double> P;

bool cmp(const P &p,const P &q){
  if(!(fabs(p.S-q.S)<=EPS))return p.S < q.S;
  return p.F > q.F;
}


int main(){
  P info[24];
  bool used[24];
  for(int i=0;i<24;i++){cin >> info[i].F >> info[i].S;used[i] = false;}
  sort(info,info+7,cmp);
  printf("%d %.2f\n",info[0].F,info[0].S);used[info[1].F] = true;
  printf("%d %.2f\n",info[1].F,info[1].S);used[info[0].F] = true;
  sort(info+8,info+15,cmp);
  printf("%d %.2f\n",info[8].F,info[8].S); used[info[8].F] = true;
  printf("%d %.2f\n",info[9].F,info[9].S); used[info[9].F] = true;
  sort(info+16,info+23,cmp);
  printf("%d %.2f\n",info[16].F,info[16].S); used[info[16].F] = true;
  printf("%d %.2f\n",info[17].F,info[17].S); used[info[17].F] = true;
  sort(info,info+23,cmp);
  int cnt = 0;
  for(int i=0;i<24;i++){
    if(!used[info[i].F]){
      cnt++;
      printf("%d %.2f\n",info[i].F,info[i].S);
    }
    if(cnt == 2)break;
  }

}

C++: #include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;
typedef pair<double,int> P;
P t[8],u[8],v[8],w[6];

void p(P x){
  cout<<x.second<<' ';
  printf("%.2f\n",x.first);
}


int main(){
  for(int i=0;i<8;i++){
    cin>>t[i].second;
    cin>>t[i].first;
  }
  sort(t,t+8);
  w[0]=t[2];w[1]=t[3];
  p(t[0]);
  p(t[1]);


  for(int i=0;i<8;i++){
    cin>>u[i].second;
    cin>>u[i].first;
  }
  sort(u,u+8);
  w[2]=u[2];w[3]=u[3];
  p(u[0]);
  p(u[1]);

  for(int i=0;i<8;i++){
    cin>>v[i].second;
    cin>>v[i].first;
  }
  sort(v,v+8);
  w[4]=v[2];w[5]=v[3];
  p(v[0]);
  p(v[1]);

  sort(w,w+6);
  p(w[0]);
  p(w[1]);
  return 0;
}

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

#define gcu getchar_unlocked
#define pcu putchar_unlocked
#define _T template <typename T>
#define _HT template <typename H, typename... T>
#define _il inline
#define _in _il int in
#define _sc _il bool scan
_T T in(int c){T n=0;bool m=false;while(isspace(c)){c=gcu();}if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m?-n:n;}
_in() {return in<int>(gcu());}
_T T scan(T &n){int c=gcu();return c==EOF?false:(n=in<T>(c),true);}
_sc(char &c){c=gcu();gcu();return c!=EOF;}
#ifdef _GLIBCXX_STRING
_sc(string &s){int c;s="";
	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
#endif
_HT _sc(H &h, T&&... t){return scan(h)&&scan(t...);}
#define _vo _il void out
#define _vl _il void outl
_vo(bool b) {pcu('0'+b);}
_vo(const char *s){while(*s)pcu(*s++);}
_vo(char c){pcu(c);}
#ifdef _GLIBCXX_STRING
_vo(string s){for(char c:s)pcu(c);}
#endif
_T _vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
_vl(){out('\n');}
#ifdef _GLIBCXX_VECTOR
_T _vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);outl();}
#endif
_HT _vo(H&& h, T&&... t){out(h);out(move(t)...);}
template <typename... T> _vl(T&&... t){out(move(t)...);outl();}

using P = pair<double, int>;
void outl(vector<P> &v) {
	sort(v.begin(), v.end());
	for (P p: {v[0], v[1]}) {
		out(p.second, ' ');
		printf("%.2lf\n", p.first);
	}
}

int main() {
	vector<P> a, b(8);
	for (int i = 0; i < 3; i++) {
		double d;
		for (P &x: b) {
			x.second = in();
			scanf("%lf", &d);
			x.first = d;
		}
		outl(b);
		a.push_back(b[2]);
		a.push_back(b[3]);
	}
	outl(a);
}

C++: #include <bits/stdc++.h>

using namespace std;

class PlayerData {
public:
	int num;
	double time;
};

PlayerData Player[24];


void show(int start) {
	cout << Player[start].num << " " << fixed << setprecision(2) << Player[start].time << endl;
	cout << Player[start + 1].num << " " << fixed << setprecision(2) << Player[start + 1].time << endl;
	Player[start].time = Player[start + 1].time = 101;
}

bool compere(const PlayerData& p1, const PlayerData& p2) {
	return p1.time < p2.time;
}

int main(void) {
	int start, end;

	for (int i = 0; i < 24; i++) {
		cin >> Player[i].num >> Player[i].time;

	}

	end = 0;
	for (int i = 0; i < 3; i++) {
		start = end;
		end += 8;
		sort(Player + start, Player + end, compere);
		show(start);
	}

	start = 0;
	sort(Player + start, Player + end, compere);
	show(start);


	return 0;
}