s=[0,0,0]
10.times do |i|
  x = gets.chomp.to_i
  
  if s[0] < x
    s[2] = s[1]
    s[1] = s[0]
    s[0] = x
    
    
  elsif s[1] < x
    s[2] = s[1]
    s[1] = x
    
  elsif s[2] < x
    s[2] = x
  end
end
puts s
