main=getLine>>=putStrLn.f
 where l = ['a'..'z']
       f (a:b:s)=if a=='A'&&(elem b l)&&(elem (last s) l) then (g (init s) False) else "WA"
       g [] t = if t then "AC" else "WA"
       g (x:s) t |t =if (elem x l) then (g s t) else "WA"
                 |x=='C' =g s True
                 |elem x l =g s t
                 |otherwise ="WA"