h = []
high = [0, 0, 0]

10.times do |i|
  h[i] = gets.chomp.to_i
end

10.times do |i|
  if high[2] < h[i]
    high[2] = h[i]
    if high[1] < h[i]
      high[2] = high[1]
      high[1] = h[i]
      if high[0] < h[i]
        high[1] = high[0]
        high[0] = h[i]
      end
    end
  end
end

3.times do |i|
  puts high[i]
end

