solve :: [String] -> [Int]
solve (a:op:b:xs)
  | op == "?" =	[]
  | op == "+" =	(read a + read b) : solve xs
  | op == "-" = (read a - read b) : solve xs
  | op == "*" =	(read a * read b) : solve xs
  | op == "/" = floor (read a / read b) : solve xs

main = getContents >>= mapM_ print . solve . words