function Main (i) {
  const isWA = (
    i.charAt(0) !== 'A' ||
    i.slice(2, i.length - 2).indexOf('C') === -1 ||
    i.match(/C/g).length !== 1 ||
    !/^[a-z]+$/.test(i.replace(/[AB\s]/, ''))
  );
  console.log('%s',isWA ? 'WA' : 'AC');
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));