// parameter "input" gets all data
function Main(input) {
  var result = 'AC';

  if (input.charAt(0) != 'A') {
    result = 'WA';
  }

  var cFound = false;
  for (var i = 1; i < input.length; i++) {
    if (input.charAt(i) === 'C') {
      if (i === 1 || i === input.length - 1 || cFound) {
        result = 'WA';
      } else {
        cFound = true;
      }
    } else if (input.charAt(i) === input.charAt(i).toUpperCase()) {
      result = 'WA';
    }
  }

  console.log(result);
}
// Don't edit this line!
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
