x = []
for i in 0 .. 9
  x[i] = gets.chomp.to_i
end
puts

rank = [x[0], x[1], x[2]]
for i in 0..(x.length-1)
  if x[i] > rank[2]
    if x[i] > rank[1]
      rank[2] = rank[1]
      if x[i] > rank[0]
        rank[1] = rank[0]
        rank[0] = x[i]
      else
        rank[1] = x[i]
      end
    else
      rank[2] = x[i]
    end
  end
end

for i in 0..(rank.length-1)
  puts rank[i].to_s
end
