heights = []

for i in range(10):

    heights.append(int(eval(input())))



for i in range(10):

    for j in range(i,10):

        if (heights[j] > heights[i]):

            w = heights[i]

            heights[i] = heights[j]

            heights[j] = w



for i in range(3):

    print((heights[i]))
heights = []

for i in range(10):

    heights.append(int(eval(input())))



for i in range(10):

    for j in range(i,10):

        if (heights[j] > heights[i]):

            w = heights[i]

            heights[i] = heights[j]

            heights[j] = w



print((heights[0]))

print((heights[1]))

print((heights[2]))
heights = []
for i in range(10):
    heights.append(int(eval(input())))
for i in range(10):
    for j in range(i, 10):
        if heights[j] > heights[i]:
            w = heights[i]
            heights[i] = heights[j]
            heights[j] = w
for i in range(3):
    print((heights[i]))

heights = []
for i in range(10):
    heights.append(int(eval(input())))
for i in range(10):
    for j in range(i, 10):
        if heights[j] > heights[i]:
            w = heights[i]
            heights[i] = heights[j]
            heights[j] = w
print((heights[0]))
print((heights[1]))
print((heights[2]))

-for i in range(3): -    print((heights[i])) +print((heights[0])) +print((heights[1])) +print((heights[2]))