import Control.Applicative
import Control.Monad
import Data.List
import Data.Array
import Data.Char

main = do
  s <- getLine
  let n = length s
      state = foldl (\(a, b) i -> if i >= 2 && i <= n - 2
        then if s !! i == 'C' then (a + 1, b) else if isUpper (s !! i) then (a, b + 1) else (a, b)
        else if isUpper (s !! i) then (a, b + 1) else (a, b)
        ) (0, 0) [1..(n - 1)]
  putStrLn $ if s !! 0 == 'A' && state == (1, 0) then "AC" else "WA"
