import Data.Maybe

solve :: [String] -> Maybe Int
solve [_,"?",_] = Nothing
solve [x,"+",y] = Just (read x + read y)
solve [x,"-",y] = Just (read x - read y)
solve [x,"*",y] = Just (read x * read y)
solve [x,"/",y] = Just (read x `div` read y)

main :: IO ()
main  = getContents
    >>= return . map words . lines
    >>= return . map solve
    >>= return . map fromJust . takeWhile (/= Nothing)
    >>= mapM_ print