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 <bits/stdc++.h>

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int,int> pii;
const int mod = (int)1e9 + 7;
void dbg(){ cerr << "\n"; }  template <typename T,typename ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }

int main(){

	vector<VI> dt(24, VI(4));
	rep(i, 24){
		int a; double b;
		cin >>a >>b;
		dt[i][0] = int(b*100);
		dt[i][1] = a;
	}
	
	rep(i, 3){
		sort(dt.begin()+i*8, dt.begin()+i*8+8);
		dt[i*8][2] = dt[i*8+1][2] = 1;
		printf("%d %.2f\n", dt[i*8][1], dt[i*8][0]/100.0);
		printf("%d %.2f\n", dt[i*8+1][1], dt[i*8+1][0]/100.0);
	}
	
	sort(all(dt));
	for(int i=0, ct=2; i<24 && ct>0 ;i++){
		if(dt[i][2] !=1){
			printf("%d %.2f\n", dt[i][1], dt[i][0]/100.0);
			ct--;
		}
	}
	return 0;
}

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;
	sort(v.begin(), v.begin() + 8, f);
	cout << v[0].first << " " << v[0].second << endl;
	cout << v[1].first << " " << v[0].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[0].second << endl;

	return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <cstdio>
#include <climits>
#include <complex>
#include <cstdint>
#include <tuple>

#define M_PI       3.14159265358979323846

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }
inline int readInt() { int x; scanf("%d", &x); return x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()


struct Edge {
    int to, cost, nm;
    Edge(int to, int cost, int nm): to(to), cost(cost), nm(nm) {}
};

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<Edge>> AdjList;
AdjList graph;
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
const int INF = 100000000;

ll GCD(ll a, ll b){
    if(a < b) swap(a, b);
    if(b == 0) return a;
    return GCD(b, a%b);
}

bool cmp(const pii& a, const pii& b){
    if(a.first == b.first){
        return a.second < b.second;
    }
    return a.first < b.first;
}

bool used[10010];
int main() {

    cout << fixed << setprecision(2);
    REP(i, 10010) used[i] = false;
    vector<pair<int, double>> ans;
    vector<pair<double, int>> vp;
    for(int i=0; i<3; ++i){
        vector<pair<double, int>> v;
        for(int j=0; j<8; ++j){
            int q; double tim;
            cin >> q >> tim;
            vp.push_back({tim, q});
            v.push_back({tim, q});
        }
        sort(all(v));
        ans.push_back({v[0].second, v[0].first});
        used[v[0].second] = true;
        ans.push_back({v[1].second, v[1].first});
        used[v[1].second] = true;
    }

    int t =0;
    sort(all(vp));
    for(int i=0; i<24; ++i){
        if(t==2) break;
        if(used[vp[i].second] == false){
            ans.push_back({vp[i].second, vp[i].first});
            used[vp[i].second] = true;
                    t++;
        }
    }

    for(auto e: ans){
        cout << e.first << " " << e.second << endl;
    }
    return 0;
}