-- Try yukicoder -- author: Leonardone @ NEETSDKASU main = getLine >>= putStrLn . unwords . map show . solve 0 0 solve a b s | take 5 s == "(^^*)" = solve (a + 1) b $ drop 5 s | take 5 s == "(*^^)" = solve a (b + 1) $ drop 5 s | otherwise = [a, b]