h = [-1, -1, -1]

10.times{
  it = gets.to_i
  if h[0] < it
    h = [it, h[0], h[1]]
  elsif h[1] < it
    h =  [h[0], it, h[1]]
  elsif h[2] < it
    h = [h[0], h[1], it]
  end
}

3.times{|i|
  puts h[i]
}