x=sorted([eval(input()) for i in range(10)])[:-4:-1]

for i in x:print(i)
for i in sorted([eval(input()) for i in range(10)])[:-4:-1]:print(i)
x = sorted([eval(input()) for i in range(10)])[:-4:-1]
for i in x:
    print(i)

for i in sorted([eval(input()) for i in range(10)])[:-4:-1]:
    print(i)

-x = sorted([eval(input()) for i in range(10)])[:-4:-1] -for i in x: +for i in sorted([eval(input()) for i in range(10)])[:-4:-1]: