let list_of_str s = let rec f i = if i >= String.length s then [] else s.[i] :: f (i+1) in f 0
let () =
  Scanf.scanf "%s" (fun s ->
    s.[0] = 'A' &&
    1 = List.length (List.filter ((=) 'C') @@ list_of_str (String.sub s 2 (String.length s - 3))) &&
    2 = List.length (List.filter (fun x -> 'A' <= x && x <= 'Z') (list_of_str s))
  ) |> fun b -> print_endline @@ if b then "AC" else "WA"