import Data.Char

solve1 :: String -> Int -> Bool
solve1 (s : sx) n
  | n == 1 && s == 'A' = (solve2 sx (n + 1) False)
  | otherwise = False

solve2 :: String -> Int -> Bool -> Bool
solve2 [] n b
  | b = True
  | otherwise = False
solve2 (s : sx) n b
  | s == 'C' && (b == True || n <= 2 || (length sx) <= 1) = False
  | s == 'C' = solve2 sx (n + 1) True
  | s /= (toLower s) = False
  | otherwise = solve2 sx (n + 1) b

main = do
  s <- getLine
  if (solve1 s 1)
  then putStrLn "AC"
  else putStrLn "WA"