cal :: [String] -> Int
cal (a:op:b:_)
    | op == "+" = read a + read b
    | op == "-" = read a - read b
    | op == "*" = read a * read b
    | op == "/" = read a `div` read b

main=do
       xs <- fmap (map words . lines) getContents
       mapM putStrLn . map show . map cal $ takeWhile (\(_:op:_) -> op /= "?") xs
