i = 0
h = -1
c = -1
l = -1
while i < 10
    x = gets.to_i
    if x > l
        if x > c
            if x > h
                l = c
                c = h
                h = x
            else
                l = c
                c = x
            end
        else
            l = x
        end
    end
    i = i + 1
end
puts h
puts c
puts l