s = []

for i in range(10):

	s.append(int(input()))

s.sort()

s.reverse()

for i in range(3):

	print(s[i])
s = []



for i in range(10):

  s.append(int(input()))



s.sort()



for i in range(3):

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

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

-s.reverse() -    print(s[i]) +    print(s[9 - i])