lst = []
for i in range(10):
    lst.append(int(input()))
for j in range(3):
    print max(lst)
    lst.remove(max(lst)) lst = [] lst [] for i in range(10):
    lst.append(int(input())) i range(10) range 10 lst.append(int(input())) lst.append lst append int(input()) int input() input for j in range(3):
    print max(lst)
    lst.remove(max(lst)) j range(3) range 3 print max(lst) max lst lst.remove(max(lst)) lst.remove lst remove max(lst) max lst lst = [] [] lst
lst = []
for i in range(10):
    lst.append(int(input()))
for j in range(3):
    print max(lst)
    lst.remove(max(lst))