let s = read_line () in
let n = String.length s in
let checkC i e =
    let rec loop i k =
        if i = e then k = 1 else
            if s.[i] = 'C' then loop (i + 1) (k + 1)
                           else loop (i + 1) k
    in
    loop i 0
in
let checkS i e =
    let rec loop i =
        if i = e then true else
            if s.[i] = 'C' then (if i >= 2 && i < e - 1 then loop (i + 1) else false)
            else if s.[i] >= 'a' && s.[i] <= 'z' then loop (i + 1) else false
    in
    loop i 
in
print_endline @@ if s.[0] = 'A' && checkC 2 (n - 1) && checkS 1 n then "AC" else "WA"