import Data.Fixed (Micro)

calc :: String -> [Micro]
calc = foldl f [] ??? words
  where
    f (x:y:zs) "+" = (y + x):zs
    f (x:y:zs) "-" = (y - x):zs
    f (x:y:zs) "*" = (y * x):zs
    f (x:y:zs) "/" = (y / x):zs
    f xs y = read y : xs

main = do
  s <- getContents
  putStr $ unlines $ map show $ map head $ map calc $ lines s