function Main (i) {
  var input = String(i);
  if (
    input.charAt(0) !== 'A' ||
    input.match(/C/g).length !== 1 ||
    !/^[a-z]+$/.test(input.replace('A', '').replace('C', '').replace(/\s/, ''))
  ) {
    console.log('%s','WA');
  } else {
    console.log('%s', 'AC');
  }

}

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