a = []
for i in range(10):
    a.append(int(raw_input()))
a.sort()
a.reverse()
for i in range(3):
    print a[i] a = [] a [] for i in range(10):
    a.append(int(raw_input())) i range(10) range 10 a.append(int(raw_input())) a.append a append int(raw_input()) int raw_input() raw_input a.sort() a.sort a sort a.reverse() a.reverse a reverse for i in range(3):
    print a[i] i range(3) range 3 print a[i] a i a = [] [] a
a = []
for i in range(10):
    a.append(int(raw_input()))
a.sort()
a.reverse()
for i in range(3):
    print a[i]