s = []

for i in range(10):
  s.append(int(raw_input()))

s.sort()

for i in range(3):
  print s[9-i] s = [] s [] for i in range(10):
  s.append(int(raw_input())) i range(10) range 10 s.append(int(raw_input())) s.append s append int(raw_input()) int raw_input() raw_input s.sort() s.sort s sort for i in range(3):
  print s[9-i] i range(3) range 3 print s[9-i] s 9-i 9 i s = [] [] s
s = []

for i in range(10):
  s.append(int(raw_input()))

s.sort()

for i in range(3):
  print s[9-i]