import Text.ParserCombinators.ReadP

parser :: ReadP ()
parser = char 'A' *> lowerChar *> many lowerChar *> char 'C' *> many lowerChar *> lowerChar *> eof

lowerChar :: ReadP Char
lowerChar = satisfy isLower

f :: String -> Result
f s = if not . null . readP_to_S parser $ s then AC else WA

main :: IO ()
main = interact $ show . f

data Result
  = AC
  | WA
  deriving (Show, Eq)
