import Control.Monad

data Judge = AC | WA deriving(Show)

alp :: [Char]
alp = ['A'..'Z']

solver' :: String -> Judge
solver' xs
    | (head xs) `elem` alp = WA
    | (last xs) `elem` alp = WA
    | otherwise            = 
        let ys = (init . tail) xs
            zs = filter (\z -> z `elem` alp) ys
            cs = length $ filter (\c -> c == 'C') zs
            in if cs /= 1 then WA 
               else if (length zs) > cs then WA 
               else AC


solver :: String -> Judge
solver []       = WA
solver (x:xs)
    | x == 'A'  = solver' xs
    | otherwise = WA


main :: IO ()
main = do
    line <- getLine
    print $ solver line
