readlines.map(&:chomp).each{|line|
  arr = line.split
  stack = []
  arr.each{|i|
    case i
    when "*"
      b = stack.pop
      a = stack.pop
      stack << a * b
    when "+"
      b = stack.pop
      a = stack.pop
      stack << a + b
    when "-"
      b = stack.pop
      a = stack.pop
      stack << a - b
    when "/"
      b = stack.pop
      a = stack.pop
      stack << a / b
    else
      stack << i.to_f
    end
  }
  puts stack[0]
}