while gets
    input = $_.split
    stack = []
    until input.empty?
        str = input.shift
        if str =~ /\d+/
            stack << str.to_f
        else
            y = stack.pop
            x = stack.pop
            stack << x.send(str, y)
        end
    end 
    puts stack
end