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++: //Name: Track and Field Competition
//Level: 1
//Category: やるだけ
//Note: 

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

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<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
typedef pair< double, int>P;

int main() {
	vector<P>v;
	rep(i, 3) {
		vector<P>h;
		rep(j, 8) {
			int p; double t; cin >> p >> t;
			h.push_back(P(t, p));
		}
		sort(h.begin(), h.end());
		printf("%d %.2lf\n%d %.2lf\n", h[0].second, h[0].first, h[1].second, h[1].first);
		for (auto iter = h.begin() + 2; iter != h.end(); iter++)v.push_back(*iter);
	}
	sort(v.begin(), v.end());
	printf("%d %.2lf\n%d %.2lf\n", v[0].second, v[0].first, v[1].second, v[1].first);
}

C++: #include<stdio.h>
#include<utility>
#include<algorithm>
#include<limits>
using namespace std;
int main()
{
	const int N1 = 3, N2=8;
	int i,j;
	pair<double,int>a[N2], w1,w2;
	w1.first = w2.first = numeric_limits<double>::max();
	for(i=0;i<N1;++i)
	{
		for(j=0;j<N2;++j)
		{
			scanf("%d %lf",&a[j].second, &a[j].first);
		}
		sort(a, a+N2);
		for(j=0;j<2;++j)
			printf("%d %.2f\n",a[j].second, a[j].first);
		for(j=2;j<4;++j)
		{
			if(w1.first > a[j].first)
			{
				w2=w1;
				w1=a[j];
			}
			else if(w2.first > a[j].first)
				w2 = a[j];
		}	
	}
	printf("%d %.2f\n"
		"%d %.2f\n", w1.second, w1.first, w2.second, w2.first);
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define rep(i,a) for(int i = 0; i < (a); i++)
#define reps(i, a, b) for(int i = (a); i < (b); i++)
#define INF 1e9
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef pair<double, int> pdi;
void output(pdi d) {
	printf("%d %lf\n", d.second, d.first);
}
int main() {
	vector<vector<pdi>> input = vector<vector<pdi>>(3, vector<pdi>(8, make_pair(0,0)));
	vector<pdi> h;
	rep(i, 3) {
		rep(j, 8) cin >> input[i][j].second >> input[i][j].first;
		sort(input[i].begin(), input[i].end(), greater<pdi>());
		rep(j, 2) {
			output(input[i].back());
			input[i].pop_back();
		}
		rep(j, input[i].size()) h.push_back(input[i][j]);
	}
	sort(h.begin(), h.end(), greater<pdi>());
	rep(i, 2) {
		output(h[h.size() - 1 - i]);
	}
	
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <functional>

using namespace std;

int main(void){
  int no;
  double time;
  vector<pair<double, int> > v;
  vector<pair<double, int> > buf;
  vector<pair<int, double> > result;

  for(int i=0; i<3; i++){
    v.clear();

    for(int j=0; j<8; j++){
      cin >> no >> time;

      v.push_back(make_pair(time, no));
    }
    sort(v.begin(), v.end());

    for(int j=0; j<8; j++){
      if(j < 2){
        result.push_back(make_pair(v[j].second, v[j].first));
      } else {
        buf.push_back(v[j]);
      }
    }
  }
  sort(buf.begin(), buf.end());
  result.push_back(make_pair(buf[0].second, buf[0].first));
  result.push_back(make_pair(buf[1].second, buf[1].first));

  for(int i=0; i<result.size(); i++){
    cout << result[i].first << " " << result[i].second << endl;
  }

  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <utility>

using namespace std;

typedef long long ll;

int main(){
	vector<vector<pair<double, int> >> v(3, vector<pair<double, int> >(8));
	vector<pair<double, int> > u;
	for (int i = 0; i < 3; i++){
		for (int j = 0; j < 8; j++){
			cin >> v[i][j].second >> v[i][j].first;
		}
		sort(v[i].begin(), v[i].end());
		cout << v[i][0].second << " " << v[i][0].first << endl;
		cout << v[i][1].second << " " << v[i][1].first << endl;
		for (int j = 2; j < 8; j++){
			u.push_back(v[i][j]);
		}
	}
	sort(u.begin(), u.end());
	cout << u[0].second << " " << u[0].first << endl;
	cout << u[1].second << " " << u[1].first << endl;
}

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

int main() {
	vector<vector<pair<double,int> > > v;
	vector<pair<double,int> > v1;
	for(int i = 0; i < 3; i++) {
		v.push_back(vector<pair<double,int> >());
		for(int j = 0; j < 8; j++) {
			pair<double,int> tmp;
			cin >> tmp.second >> tmp.first;
			v[i].push_back(tmp);
		}
		sort(v[i].begin(), v[i].end());
		for(int j = 0; j < 2; j++) {
			printf("%d %.2f\n", v[i][j].second, v[i][j].first);
		}
		v1.insert(v1.end(), v[i].begin() + 2, v[i].end());
	}

	sort(v1.begin(), v1.end());
	for(int j = 0; j < 2; j++) {
		printf("%d %.2f\n", v1[j].second, v1[j].first);
	}

}

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

map<double, int> t[4];


int main()
{
  int aa;
  double bb;
  for(int i = 0; i < 3; i++)
  {
    for(int j = 0; j < 8; j++)
    {
      cin >> aa >> bb;
      t[i][bb] = aa;
    }
  }
  for(int i = 0; i < 3; i++)
  {
    map<double, int>::iterator it = t[i].begin();
    printf("%d %2.2f\n", (*it).second, (*it).first);
    it++;
    printf("%d %2.2f\n", (*it).second, (*it).first);
    it++;
    for(;it != t[i].end(); it++)
      t[3][(*it).first] = (*it).second;
  }
  map<double, int>::iterator it = t[3].begin();
  printf("%d %2.2f\n",  (*it).second, (*it).first);
  it++;
  printf("%d %2.2f\n",  (*it).second, (*it).first);
}