# Python 3+

#-------------------------------------------------------------------------------

import sys



#ff = open("test.txt", "r")

ff = sys.stdin



arr = [ int(x) for x in ff.readlines() ]



arr.sort(reverse=True)



for x in arr[0:3] : print(x)


cnt = 10

top3 = [0,0,0]



for x in range(cnt):

    n = int( input() )



    if top3[2] > n: continue

    top3[2] = n



    if top3[1] > top3[2]: continue

    top3[1], top3[2] = top3[2], top3[1]



    if top3[0] > top3[1]: continue

    top3[0], top3[1] = top3[1], top3[0]



print(top3[0])

print(top3[1])

print(top3[2])



# Python 3+
# -------------------------------------------------------------------------------
import sys

# ff = open("test.txt", "r")
ff = sys.stdin
arr = [int(x) for x in ff.readlines()]
arr.sort(reverse=True)
for x in arr[0:3]:
    print(x)

cnt = 10
top3 = [0, 0, 0]
for x in range(cnt):
    n = int(input())
    if top3[2] > n:
        continue
    top3[2] = n
    if top3[1] > top3[2]:
        continue
    top3[1], top3[2] = top3[2], top3[1]
    if top3[0] > top3[1]:
        continue
    top3[0], top3[1] = top3[1], top3[0]
print(top3[0])
print(top3[1])
print(top3[2])

-# Python 3+ -import sys - -# ff = open("test.txt", "r") -ff = sys.stdin -arr = [int(x) for x in ff.readlines()] -arr.sort(reverse=True) -for x in arr[0:3]: -    print(x) +cnt = 10 +top3 = [0, 0, 0] +for x in range(cnt): +    n = int(input()) +    if top3[2] > n: +        continue +    top3[2] = n +    if top3[1] > top3[2]: +        continue +    top3[1], top3[2] = top3[2], top3[1] +    if top3[0] > top3[1]: +        continue +    top3[0], top3[1] = top3[1], top3[0] +print(top3[0]) +print(top3[1]) +print(top3[2])