l = []



for i in range(10):

    l.append(int(eval(input())))



l.sort()



for i in range(3):

    print((l[-1 * (i+1)]))
mountains = []

for x in range(10):

    mountains.append(int(input()))

mountains.sort()

print((mountains[-1]))

print((mountains[-2]))

print((mountains[-3]))
l = []
for i in range(10):
    l.append(int(eval(input())))
l.sort()
for i in range(3):
    print((l[-1 * (i + 1)]))

mountains = []
for x in range(10):
    mountains.append(int(input()))
mountains.sort()
print((mountains[-1]))
print((mountains[-2]))
print((mountains[-3]))

-l = [] -for i in range(10): -    l.append(int(eval(input()))) -l.sort() -for i in range(3): -    print((l[-1 * (i + 1)])) +mountains = [] +for x in range(10): +    mountains.append(int(input())) +mountains.sort() +print((mountains[-1])) +print((mountains[-2])) +print((mountains[-3]))