const main = function(input){
  var str = input;
  var len = str.length;

  console.log(str[len-1]);
  if(str[0]!=="A" || isUpper(str[1]) ||isUpper(str[len-1])){
    console.log("WA");
    return;
  }

  var CCount=0;
  for(var i=2;i<len-1;i++){
    if(str[i]==="C") CCount++;
  }
  if(CCount===1) console.log("AC");
  else console.log("WA");
}

const isUpper = function (str){
  return str===str.toUpperCase();
}
 
 
main(require("fs").readFileSync("/dev/stdin","utf-8"));