type Op = String
type Formula = (Int,Op,Int)

toFormula :: [String]->Formula
toFormula [x,y,z] = (read x::Int, y ::Op, read z::Int)

prepare :: String->[Formula]
prepare=map toFormula.map words.lines

putMaybe :: Maybe Int->IO ()
putMaybe (Just x) = putStrLn x

calc :: Formula->Maybe Int
calc xs = case xs of
	(x,"+",z)->Just $ x+z
	(x,"-",z)->Just $ x-z
	(x,"*",z)->Just $ x*z
	(x,"/",z)->Just $ x`div`z
	(_,"?",_)->Nothing

main=getContents>>=mapM_ putMaybe.takeWhile (/=Nothing).map calc.prepare