height_array =[0, 0, 0]
for i in 1..10
     new_height = gets.to_i
    if height_array[0] <= new_height 
        height_array[2] = height_array[1]
        height_array[1] = height_array[0]
        height_array[0] = new_height
    elsif height_array[1] <= new_height
        height_array[2] = height_array[1]
        height_array[1] = new_height
    elsif height_array[2] <= new_height
        height_array[2] = new_height
    else
    end
end
height_array.each do |height|
    puts height
end