import Data.List
import Data.Char

main=do
    s<-getLine
    putStrLn $ f1 s
    --
    return ()

f1 (a:sr)
    | a /= 'A' = "WA"
    | otherwise = f2 sr

f2 (a:sr) = f3 (a:v) u
    where (u,v) = splitAt ((length sr)-1) sr

f3 ss sc =
    case findIndices (=='C') sc of
        [i] -> f4 (ss ++ filter (/='C') sc)
        otherwise -> "WA"

f4 xx = if all isLower xx then "AC" else "WA"