an1, at1, an2, at2 = 0, 1000, 0, 1000

for i in range(3):

    n1, t1, n2, t2 = 0, 1000, 0, 1000

    for j in range(8):

        n, t = list(map(float, input().split()))

        if t < t1:

            if t2 < at1:

                an1 = n2; at1 = t2

            elif t2 < at2:

                an2 = n2; at2 = t2

            n2 = n1; t2 = t1

            n1 = n ; t1 = t

        elif t < t2:

            if t2 < at1:

                an1 = n2; at1 = t2

            elif t2 < at2:

                an2 = n2; at2 = t2

            n2 = n ; t2 = t

        else:

            if t < at1:

                an1 = n; at1 = t

            elif t < at2:

                an2 = n; at2 = t

    print("%d %4.2f"%(int(n1), t1))

    print("%d %4.2f"%(int(n2), t2))

print("%d %4.2f"%(int(an1), at1))

print("%d %4.2f"%(int(an2), at2))
def check(x,y):

    global an1,at1,an2,at2

    if y < at1:

        an1,at1 = x,y

    elif y < at2:

        an2,at2 = x,y



an1, at1, an2, at2 = 0, 1000, 0, 1000

for i in range(3):

    n1, t1, n2, t2 = 0, 1000, 0, 1000

    for j in range(8):

        n, t = list(map(float, input().split()))

        if t < t1:

            check(n2,t2)

            n1,t1,n2,t2 = n,t,n1,t1

        elif t < t2:

            check(n2,t2)

            n2, t2 = n, t

        else:

            check(n,t)

    print("%d %4.2f"%(int(n1), t1))

    print("%d %4.2f"%(int(n2), t2))

print("%d %4.2f"%(int(an1), at1))

print("%d %4.2f"%(int(an2), at2))
an1, at1, an2, at2 = 0, 1000, 0, 1000
for i in range(3):
    n1, t1, n2, t2 = 0, 1000, 0, 1000
    for j in range(8):
        n, t = list(map(float, input().split()))
        if t < t1:
            if t2 < at1:
                an1 = n2
                at1 = t2
            elif t2 < at2:
                an2 = n2
                at2 = t2
            n2 = n1
            t2 = t1
            n1 = n
            t1 = t
        elif t < t2:
            if t2 < at1:
                an1 = n2
                at1 = t2
            elif t2 < at2:
                an2 = n2
                at2 = t2
            n2 = n
            t2 = t
        else:
            if t < at1:
                an1 = n
                at1 = t
            elif t < at2:
                an2 = n
                at2 = t
    print("%d %4.2f" % (int(n1), t1))
    print("%d %4.2f" % (int(n2), t2))
print("%d %4.2f" % (int(an1), at1))
print("%d %4.2f" % (int(an2), at2))

def check(x, y):
    global an1, at1, an2, at2
    if y < at1:
        an1, at1 = x, y
    elif y < at2:
        an2, at2 = x, y


an1, at1, an2, at2 = 0, 1000, 0, 1000
for i in range(3):
    n1, t1, n2, t2 = 0, 1000, 0, 1000
    for j in range(8):
        n, t = list(map(float, input().split()))
        if t < t1:
            check(n2, t2)
            n1, t1, n2, t2 = n, t, n1, t1
        elif t < t2:
            check(n2, t2)
            n2, t2 = n, t
        else:
            check(n, t)
    print("%d %4.2f" % (int(n1), t1))
    print("%d %4.2f" % (int(n2), t2))
print("%d %4.2f" % (int(an1), at1))
print("%d %4.2f" % (int(an2), at2))

+def check(x, y): +    global an1, at1, an2, at2 +    if y < at1: +        an1, at1 = x, y +    elif y < at2: +        an2, at2 = x, y + + -            if t2 < at1: -                an1 = n2 -                at1 = t2 -            elif t2 < at2: -                an2 = n2 -                at2 = t2 -            n2 = n1 -            t2 = t1 -            n1 = n -            t1 = t +            check(n2, t2) +            n1, t1, n2, t2 = n, t, n1, t1 -            if t2 < at1: -                an1 = n2 -                at1 = t2 -            elif t2 < at2: -                an2 = n2 -                at2 = t2 -            n2 = n -            t2 = t +            check(n2, t2) +            n2, t2 = n, t -            if t < at1: -                an1 = n -                at1 = t -            elif t < at2: -                an2 = n -                at2 = t +            check(n, t)