main = getContents >>= mapM_ (putStrLn . fout . simple_calculator . fin) . takeWhile (notElem '?') . lines
fin = words
fout = show
simple_calculator [a,op,b] = calc (read a) (read b)
 where calc = case op of {"+" -> (+); "-" -> (-); "*" -> (*); "/" -> div}