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
}

Python: l1,l2,l3=[],[],[]
final=[]
count=0
for i in range(24):
    p,t=map(float,input().split())
    if count<=7:l1.append([t,p])
    elif 7<count<=15:l2.append([t,p])
    elif 15<count<=23:l3.append([t,p])
    count +=1
l1=sorted(l1)
l2=sorted(l2)
l3=sorted(l3)
final +=[l1[0],l1[1],l2[0],l2[1],l3[0],l3[1]]
del l1[0],l1[0],l2[0],l2[0],l3[0],l3[0]
third=sorted(l1+l2+l3)
final +=[third[0],third[1]]
for i in range(8):print(int(final[i][1]),final[i][0])

Python: import heapq
from collections import namedtuple

Data = namedtuple("Data", ("time", "number"))

all_player = []

for _ in range(3):
    player = [input().split(" ") for lp in range(8)]
    player = [Data(float(time), number) for number, time in player]

    heapq.heapify(player)
    data = heapq.heappop(player)
    print(data.number, data.time)
    data = heapq.heappop(player)
    print(data.number, data.time)

    all_player.extend(player)

heapq.heapify(all_player)
data = heapq.heappop(all_player)
print(data.number, data.time)
data = heapq.heappop(all_player)
print(data.number, data.time)

Python: def inp():
  return sorted([list(map(float, input().split())) for _ in range(8)], key=lambda x:x[1])
lst1 = inp()
lst2 = inp()
lst3 = inp()
rest = lst1[2:] + lst2[2:] + lst3[2:]
rest.sort(key=lambda x:x[1])
select = lst1[:2] + lst2[:2] + lst3[:2] + rest[:2]
for p, t in select:
  print(int(p), t)

Python: R = []

for _ in range(3):
    L = []
    for i in range(8):
        p, t = input().split()
        p = int(p)
        t = float(t)
        L.append((p,t))
    
    L.sort(key=lambda x: x[1])
    for i in [0, 1]:
        print(*L[i])
    R.extend(L[2:])

R.sort(key=lambda x: x[1])
for i in [0, 1]:
    print(*R[i])

Python: class Player:

    def __init__(self, id, score):
        self.id = id
        self.score = score

    def __lt__(self, other):
        return float(self.score) < float(other.score)

    def print(self):
        print(self.id, self.score)

g1 = []
for l in range(8):
    p,t = input().split()
    g1.append(Player(p, t))

g2 = []
for l in range(8):
    p,t = input().split()
    g2.append(Player(p,t))

g3 = []
for l in range(8):
    p,t = input().split()
    g3.append(Player(p,t))

g1.sort()
g2.sort()
g3.sort()

g4 = []
g4.append(g1[2])
g4.append(g2[2])
g4.append(g3[2])
g4.sort()

g1[0].print()
g1[1].print()
g2[0].print()
g2[1].print()
g3[0].print()
g3[1].print()
g4[0].print()
g4[1].print()

Python: import heapq
from collections import namedtuple

Data = namedtuple("Data", "time number")

all_player = []

for _ in range(3):
    player = [input().split(" ") for lp in range(8)]
    player = [Data(float(time), number) for number, time in player]

    heapq.heapify(player)
    data = heapq.heappop(player)
    print(data.number, data.time)
    data = heapq.heappop(player)
    print(data.number, data.time)

    all_player.extend(player)

heapq.heapify(all_player)
data = heapq.heappop(all_player)
print(data.number, data.time)
data = heapq.heappop(all_player)
print(data.number, data.time)

Python: pts = [[input().split() for _ in range(8)] for _ in range(3)]
npts = [sorted(pts[i], key=lambda x: float(x[1]))[:4] for i in range(3)]
ts = [sorted((npts[i][j] for i in range(3) for j in range(2, 4)), key=lambda x: float(x[1]))[:2]]
gen = (print(*npts[i][j]) for i in range(3) for j in range(2))
ans = lambda *x: print(*ts[0][0])
ans(*gen)
print(*ts[0][1])

Python: hoketsu_1 = [0, 100]
hoketsu_2 = [0, 100]
for x in range(3) :
    Time = []
    for i in range(8) :
        p, t = input().split()
        Time.append([p, t])
    Time.sort(key = lambda x: x[1])
    print(*Time[0])
    print(*Time[1])
    
    if float(Time[2][1]) < float(hoketsu_1[1]) :
        hoketsu_2 = hoketsu_1
        hoketsu_1 = Time[2]
    elif float(Time[2][1]) < float(hoketsu_2[1]) :
        hoketsu_2 = Time[2]
    if float(Time[3][1]) < float(hoketsu_2[1]) :
        hoketsu_2 = Time[3]
print(*hoketsu_1)
print(*hoketsu_2)

Python: # AOJ 0138 Track and Field Competition
# Python3 2018.6.19 bal4u

q = {}
for i in range(3):
	g = {}
	for j in range(8):
		p, t = list(input().split())
		g[p] = t
	x = list(sorted(g.items(), key=lambda x:x[1]))
	print(*x[0])
	print(*x[1])
	del g[x[0][0]]
	del g[x[1][0]]
	q.update(g)
x = sorted(q.items(), key=lambda x:x[1])
print(*x[0])
print(*x[1])

Python: # -*- coding: utf-8 -*-

import sys
import os
import math

N = 24
A = []
for i in range(N):
    id, t = map(float, input().split())
    id = int(id)
    A.append((t, id))

B = A[:8]
C = A[8:16]
D = A[16:]

B.sort()
C.sort()
D.sort()

def print_data(A, index):
    data = A[index]
    t = data[0]
    id = data[1]
    print(id, t)

print_data(B, 0)
print_data(B, 1)
print_data(C, 0)
print_data(C, 1)
print_data(D, 0)
print_data(D, 1)

B = B[2:]
C = C[2:]
D = D[2:]

E = B + C + D
E.sort()
print_data(E, 0)
print_data(E, 1)

Python: data = []
tmp = []
ans = []

def pushAns(d):
    for j in range(2):
        ans.append((d[0][0],d[0][1]))
        d.pop(0)    

for i in range(24):
    a,b = (float(x) for x in input().split())
    tmp.append((a,b))
    if (i + 1) % 8 == 0:
        tmp.sort(key=lambda x:x[1])
        pushAns(tmp)
        data.extend(tmp)
        tmp.clear()
        
data.sort(key=lambda x:x[1])
pushAns(data)

for i in range(8):
    print(int(ans[i][0]),ans[i][1])