first=0
second=0
third=0
for i in 1..10 do
  inp=gets.to_i
  if first<inp then
    third=second
    second=first
    first=inp
  elsif second<inp then
    third=second
    second=inp
  elsif third<inp then
    third=inp
  end
end
print(first,"\n",second,"\n",third,"\n")