man = []
max = 0
max2 = 0
max3 = 0
temp = 0
10.times do |i|
    man[i] = gets.to_i 
    if man[i]  >=  10000 && man[i] <= 0 then
        man[i] = gets.to_i 
    end
end

10.times do |i|
    if max < man[i] then
       max = man[i]
    end
end
    
10.times do |i|
    if max > man[i] && max2 < man[i]  then
       max2 = man[i]
    end 
end
 
10.times do |i|
    if max2 > man[i] && max3 < man[i]  then
       max3 = man[i]
    end
end


    puts max
    puts max2
    puts max3