calc :: [String] -> Int
calc [a,op,b]
  | op == "+" = a' + b'
  | op == "-" = a' - b'
  | op == "*" = a' * b'
  | otherwise = a' `div` b'
  where
    a' = read a
    b' = read b

input3 :: IO [Int]
input3 = loop []
  where
    loop :: [Int] -> IO [Int]
    loop list = do
    temp <- getLine
    let [a,op,b] = words temp
    if op == "?"
      then return list
      else loop (list ++ [calc [a,op,b]])

main = input3 >>= (\n -> mapM_ print n)

