function Main(s){
  ans = "AC"
  if(s[0] !== "A")ans = "WA";
  var f = 0;
  for(var i = 1; i < s.length; i++){
    if(s[i] === "C"){
      if(i > 1 && s.length - 1 > i)f++;else ans = "WA";
    }else{
      if("a" > s[i]) ans = "WA";
    }
  }
  if(f !== 1)ans = "WA";
  console.log(ans);
}

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