import Data.Char 

main = do
  s <- getLine
  putStrLn $ if (startWithA s && check (tail s)) then "AC" else "WA"
 
 
startWithA :: String -> Bool
startWithA = (== 'A') . head
 
check :: String -> Bool
check s = inCheck False 1 (length s) s
  where
    inCheck :: Bool -> Int -> Int -> String -> Bool
    inCheck True _ _ [] = True
    inCheck False _ _ [] = False
    inCheck b cur len (x:xs) = 
      case x of
        'C' -> if cur >= 2 && cur <= len-1 && not b then inCheck True (cur+1) len xs else False
        c -> if isLower c then inCheck b (cur+1) len xs else False