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<map>
#include<algorithm>
#include<stdio.h>

using namespace std;

int main(){

  double time[24];
  int num;

  map <double, int> M;

  for(int i = 0; i < 3; i++){
    for(int j = i*8; j < i*8+8; j++){
      cin >> num >> time[j];
      M[time[j]] = num;
    }

    sort(time+i*8, time+i*8+8);

    for(int j = i*8; j < i*8+2; j++){
      printf("%d %.2f\n",M[time[j]],time[j]);
      time[j] = -1;
    }
  }

  sort(time, time+24);

  int j = 0;

  for(int i = 0; j < 2; i++){
    if(time[i] > 0){
      printf("%d %.2f\n",M[time[i]],time[i]);
      j++;
    }
  }
  return 0;

}

C++: //Name: Track and Field Competition
//Level: 1
//Category: やるだけ
//Note: 

/**
 */
#include <iostream>
#include <vector>

using namespace std;

void calc(vector<pair<double,int>> &v) {
    sort(begin(v), end(v));
    cout << v[0].second << ' ' << v[0].first << endl;
    cout << v[1].second << ' ' << v[1].first << endl;
}

bool solve(bool first) {
    vector<pair<double,int>> v(8), rem;
    for(int i = 0; i < 3; ++i) {
        for(int i = 0; i < 8; ++i) {
            cin >> v[i].second >> v[i].first;
        }
        calc(v);
        rem.insert(end(rem), begin(v)+2, end(v));
    }
    calc(rem);
    return false;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout.setf(ios::fixed);
    cout.precision(2);

    bool first = true;
    while(solve(first)) {
        first = false;
    }
    return 0;
}

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

int main(void)
{
	vector< pair <double, int> > data1, data2, data3, data4;
	int num;
	double time;

	for (int i = 0; i < 8; i++){
		cin >> num >> time;
		data1.push_back(make_pair(time, num));
	}
	for (int i = 0; i < 8; i++){
		cin >> num >> time;
		data2.push_back(make_pair(time, num));
	}
	for (int i = 0; i < 8; i++){
		cin >> num >> time;
		data3.push_back(make_pair(time, num));
	}
	sort(data1.begin(), data1.end());
	sort(data2.begin(), data2.end());
	sort(data3.begin(), data3.end());
	cout << data1[0].second << " " << data1[0].first << endl;
	cout << data1[1].second << " " << data1[1].first << endl;
	cout << data2[0].second << " " << data2[0].first << endl;
	cout << data2[1].second << " " << data2[1].first << endl;
	cout << data3[0].second << " " << data3[0].first << endl;
	cout << data3[1].second << " " << data3[1].first << endl;

	for (int i = 0; i < 6; i++)
	{
		data4.push_back(data1[i+2]);
		data4.push_back(data2[i+2]);
		data4.push_back(data3[i+2]);
	}
	sort(data4.begin(), data4.end());

	cout << data4[0].second << " " << data4[0].first << endl;
	cout << data4[1].second << " " << data4[1].first << endl;

	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <cmath>
#include <sstream>
#include <algorithm>
using namespace std;

typedef long long ll;
typedef pair<double,double> P;
const int MAX=1000000000;

int main() {
  vector<P> a[3];
  for(int i=0; i<3; i++) {
    for(int j=0; j<8; j++) {
      double x,y;
      cin >> x >> y;
      a[i].push_back(P(y,x));
    }
    sort(a[i].begin(),a[i].end());
  }
  vector<P> b;
  for(int i=0; i<3; i++) {
    b.push_back(P(a[i][2].first,a[i][2].second));
    b.push_back(P(a[i][3].first,a[i][3].second));
  }
  sort(b.begin(),b.end());
  for(int i=0; i<3; i++) {
    for(int j=0; j<2; j++) printf("%d %.2f\n",(int)a[i][j].second,a[i][j].first);
  }
  for(int j=0; j<2; j++) printf("%d %.2f\n",(int)b[j].second,b[j].first);
  return 0;
}

C++: #include<stdio.h>

struct NU{int n;double m;int s;int S;};

int main(){
int n,s;
double m;
struct NU num[25],n2[18];
for(int i=0;i<3;i++){

for(int j=0;j<8;j++){
scanf("%d %lf",&n,&m);
num[j].n=n;num[j].m=m;
//printf("%d %lf[%d]\n",num[j].n,num[j].m,j);
}

for(int j=0;j<8;j++){
//	printf("%d %lf\n",num[j].n,num[j].m);
for(int k=8-1;k>j;k--){
if(num[k-1].m>num[k].m){struct NU t=num[k-1];num[k-1]=num[k];num[k]=t;}
}
}
for(int j=0;j<8;j++){
if(j<2)printf("%d %.2lf\n",num[j].n,num[j].m);
else if(j>=2&&i==0)n2[j-2]=num[j];
else if(j>=2&&i==1)n2[j-2+6]=num[j];
else if(j>=2&&i==2)n2[j-2+12]=num[j];
}
}

for(int j=0;j<19;j++){
for(int k=17;k>j;k--){
if(n2[k-1].m>n2[k].m){struct NU tt=n2[k-1];n2[k-1]=n2[k];n2[k]=tt;}
}
}

for(int j=0;j<2;j++){
if(j<2)printf("%d %.2lf\n",n2[j].n,n2[j].m);
//else if(j>=2)n2[j]=num[j];
}

return 0;
}

C++: #include <iostream>
#include <functional>
#include <vector>
#include <cstdio>

using namespace std;

class Player{
public:
	int number;
	double time;
	
	Player(){
		number = 0;
		time = 0;
	}
	
	bool operator<( const Player& lhs ) const{
		return time < lhs.time;
	}
	bool operator>( const Player& lhs ) const{
		return time > lhs.time;
	}
};

int main(int argc, char const* argv[])
{
	vector<Player> race1( 8 );
	vector<Player> race2( 8 );
	vector<Player> race3( 8 );
	vector<Player> race( 18 );

	for( int i = 0;i < 8;i++ ){
		cin >> race1[i].number;
		cin >> race1[i].time;
	}
	for( int i = 0;i < 8;i++ ){
		cin >> race2[i].number;
		cin >> race2[i].time;
	}
	for( int i = 0;i < 8;i++ ){
		cin >> race3[i].number;
		cin >> race3[i].time;
	}

	sort( race1.begin(), race1.end(), greater<Player>() );

	printf("%d %.2f\n",race1[7].number, race1[7].time );
	printf("%d %.2f\n",race1[6].number, race1[6].time );
	race1.pop_back();
	race1.pop_back();

	sort( race2.begin(), race2.end() , greater<Player>());

	printf("%d %.2f\n",race2[7].number, race2[7].time );
	printf("%d %.2f\n",race2[6].number, race2[6].time );

	race2.pop_back();
	race2.pop_back();
	sort( race3.begin(), race3.end(), greater<Player>() );

	printf("%d %.2f\n",race3[7].number, race3[7].time );
	printf("%d %.2f\n",race3[6].number, race3[6].time );
	race3.pop_back();
	race3.pop_back();

	for( int i = 0;i < 6;i++ ){
		race[i] = race1[i];
		race[i + 6] = race2[i];
		race[i + 12] = race3[i];
	}

	sort( race.begin(), race.end(), greater<Player>() );

	
	printf("%d %.2f\n",race[17].number, race[17].time );
	printf("%d %.2f\n",race[16].number, race[16].time );
	return 0;
}