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 <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef pair<double,int> P;
static const double EPS = 1e-5;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)

int main(void){
  vector<P> d1;
  vector<P> d2;
  REP(i,8){
    double a;int b;
    cin>>b>>a;
    d1.push_back(P(a,b));
  }
  sort(d1.begin(),d1.end());
  REP(i,8){
    if(i<2){
      printf("%d %.2lf\n",d1[i].second,d1[i].first); 
    }else{
      d2.push_back(d1[i]);
    }
  }
  d1.clear();
  REP(i,8){
    double a;int b;
    cin>>b>>a;
    d1.push_back(P(a,b));
  }
  sort(d1.begin(),d1.end());
  REP(i,8){
    if(i<2){
      printf("%d %.2lf\n",d1[i].second,d1[i].first); 
    }else{
      d2.push_back(d1[i]);
    }
  }
  d1.clear();
  REP(i,8){
    double a;int b;
    cin>>b>>a;
    d1.push_back(P(a,b));
  }
  sort(d1.begin(),d1.end());
  REP(i,8){
    if(i<2){
      printf("%d %.2lf\n",d1[i].second,d1[i].first); 
    }else{
      d2.push_back(d1[i]);
    }
  }
  sort(d2.begin(),d2.end());
  REP(i,2){
    printf("%d %.2lf\n",d2[i].second,d2[i].first); 
  }
  return 0;
}

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

class player {
public:
    int id;
    double time;
    player(int _id, double _time) { id = _id; time = _time; }
};

int main()
{
    int id; double time;
    auto comp = [](const player &a, const player &b) {
        return a.time > b.time;
    };
    priority_queue<player, vector<player>, decltype (comp)> pq1(comp), pq2(comp), pq3(comp), b3(comp);
    for (int i = 0; i < 8; i++) { scanf("%d %lf", &id, &time); pq1.push(player(id, time)); }
    for (int i = 0; i < 8; i++) { scanf("%d %lf", &id, &time); pq2.push(player(id, time)); }
    for (int i = 0; i < 8; i++) { scanf("%d %lf", &id, &time); pq3.push(player(id, time)); }
    for (int i = 0; i < 2; i++) { printf("%d %.2lf\n", pq1.top().id, pq1.top().time); pq1.pop(); }
    b3.push(pq1.top());
    for (int i = 0; i < 2; i++) { printf("%d %.2lf\n", pq2.top().id, pq2.top().time); pq2.pop(); }
    b3.push(pq2.top());
    for (int i = 0; i < 2; i++) { printf("%d %.2lf\n", pq3.top().id, pq3.top().time); pq3.pop(); }
    b3.push(pq3.top());
    for (int i = 0; i < 2; i++) { printf("%d %.2lf\n", b3.top().id, b3.top().time); b3.pop(); }
    return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>

using namespace std;

typedef long long ll;
typedef pair<double,int> P;

static const double eps = 10e-9;

int main(){
	int n;
	vector<P> remain;
	for(int i=0;i<3;i++){
		vector<P> men;
		for(int j=0;j<8;j++){
			int num;
			double time;
			
			scanf("%d %lf",&num,&time);
			men.push_back(P(time,num));
		}

		sort(men.begin(),men.end());
		printf("%d %.2lf\n",men[0].second,men[0].first);
		printf("%d %.2lf\n",men[1].second,men[1].first);
		for(int j=2;j<men.size();j++) remain.push_back(men[j]);
	}

	sort(remain.begin(),remain.end());
	printf("%d %.2lf\n",remain[0].second,remain[0].first);
	printf("%d %.2lf\n",remain[1].second,remain[1].first);

}

C++: #include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
#include <iomanip>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
typedef pair<double,int> pdi;
int main(){
	vector<pdi> data[4];
	int k = 0;
	for(int i =0; i< 24;i++){
		int p;
		double t;
		cin>>p>>t;
		if(i<8){
			data[k].push_back(pdi(t,p));
		}else if(i>=8&&i <16){
			if(k==0){
				k++;
			}
			data[k].push_back(pdi(t,p));
		}else if(i>=16){
			if(k==1){
				k++;
			}
			data[k].push_back(pdi(t,p));
		}
	}
	for(int k = 0;k < 3;k++){
		sort(data[k].begin(),data[k].end());
	}
	cout <<fixed<<setprecision(2);
	for(int k =0;k <3;k++){
		for(int i =0;i <2;i++){
			cout <<data[k][i].second<<" "<<data[k][i].first<<endl;
		}
		data[3].push_back(pdi(data[k][2].first,data[k][2].second));
	}
	sort(data[3].begin(),data[3].end());
	for(int i =0;i <2;i++){
		cout <<data[3][i].second<<" "<<data[3][i].first<<endl;
	}
	return 0;
}