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 <fstream>
#include <sstream>
#include <iomanip>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm>
#include <numeric>
#include <typeinfo>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <ctime>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define foreach(i,c) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

int main()
{
	vector<pair<double,int> > times(24);
	rep(i,24)
		cin>>times[i].second>>times[i].first;
	sort(times.begin()+0,times.begin()+8);
	sort(times.begin()+8,times.begin()+16);
	sort(times.begin()+16,times.begin()+24);
	typeof(times) times2;
	rep(i,3) rep(j,6)
		times2.push_back(times[i*8+j+2]);
	sort(allof(times2));
	
	rep(i,3) rep(j,2)
		printf("%d %.2f\n",times[i*8+j].second,times[i*8+j].first);
	rep(i,2)
		printf("%d %.2f\n",times2[i].second,times2[i].first);
	
	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<int,double> > 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));
    cout<<timer[0].second << " " << timer[0].first<<endl;
    cout<<timer[1].second << " " << timer[1].first<<endl;
    loop(i,2,timer.size()){
      other.push_back(timer[i]);
    }
    timer.clear();
  }
  sort(all(other));
  cout<<other[0].second << " " << other[0].first<<endl;
  cout<<other[1].second << " " << other[1].first<<endl;

}

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

#define rep_(v, f, l) for (int v = (f); v < (l); ++v)
#define rep(v, n) rep_(v, 0, n)
#define lep(v, n) rep_(v, 1, n + 1)

using namespace std;

typedef long long int lint;
typedef pair<double, int> pdi;

static inline int in(){ int x; scanf("%d", &x); return x; }
static inline lint inl(){ lint x; scanf("%lld", &x); return x; }

int main()
{
    vector<pdi> a, b, c, total;
    rep(i, 24){
        double record;
        int id;
        scanf("%d %lf", &id, &record);
        if (i < 8){
            a.push_back(make_pair(record, id));
        }
        else if (i < 16){
            b.push_back(make_pair(record, id));
        }
        else {
            c.push_back(make_pair(record, id));
        }
    }
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    sort(c.begin(), c.end());
    rep(j, 3){
        rep(i, 2){
            if (j == 0){
                printf("%d %.2f\n", a[i].second, a[i].first);
            }
            if (j == 1){
                printf("%d %.2f\n", b[i].second, b[i].first);
            }
            if (j == 2){
                printf("%d %.2f\n", c[i].second, c[i].first);
            }
        }
    }
    rep(i, 6){
        total.push_back(a[i + 2]);
        total.push_back(b[i + 2]);
        total.push_back(c[i + 2]);
    }
    sort(total.begin(), total.end());
    rep(i, 2){
        printf("%d %.2f\n", total[i].second, total[i].first);
    }

    return (0);
}

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

int main ()
{
    vector<pair<double,int> > v1(8);
    vector<pair<double,int> > v2(8);
    vector<pair<double,int> > v3(8);
    vector<pair<double,int> > tmp;
    for (auto &i : v1) cin >> i.second >> i.first;
    for (auto &i : v2) cin >> i.second >> i.first;
    for (auto &i : v3) cin >> i.second >> i.first;
    sort(v1.begin(), v1.end());
    sort(v2.begin(), v2.end());
    sort(v3.begin(), v3.end());

    cout << v1[0].second << " " << v1[0].first << endl;
    cout << v1[1].second << " " << v1[1].first << endl;
    cout << v2[0].second << " " << v2[0].first << endl;
    cout << v2[1].second << " " << v2[1].first << endl;
    cout << v3[0].second << " " << v3[0].first << endl;
    cout << v3[1].second << " " << v3[1].first << endl;

    tmp.push_back(v1[2]);
    tmp.push_back(v1[3]);
    tmp.push_back(v2[2]);
    tmp.push_back(v2[3]);
    tmp.push_back(v3[2]);
    tmp.push_back(v3[3]);

    sort(tmp.begin(), tmp.end());

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

    return 0;
}

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

typedef pair <double, int> PDI;

void print( PDI p )
{
    printf( "%d %.2f\n", p.second, p.first );
}

int main() {
    vector <PDI> big_list(18);
    int bl_index=0;
    for ( int i = 0; i < 3; i++ ) {
        vector <PDI> list( 8 );
        for ( int j = 0; j < 8; j++ ) {
            cin >> list[j].second >> list[j].first;
        }

        sort( list.begin(), list.end() );
        print( list[0] );
        print( list[1] );

        for ( int j = 2; j < 8; j++ ) {
            big_list[bl_index++] = list[j];
        }
    }

    sort( big_list.begin(), big_list.end() );
    print( big_list[0] );
    print( big_list[1] );

    return 0;
}