var toInt = x=>parseInt(x,10);
var toIntArr = arr=>arr.map(x=>toInt(x));
var abs = x=>x>0?x:-x;
function min(){var rest = arguments,val=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]<val)val = rest[i];return val}
function max(){var rest = arguments,val=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]>val)val = rest[i];return val}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
 
function Main(input){
	var input = input.split('\n');
	var s = input[0];
	var n = s.length;
	var isC = 0;
	if(s[0]!=='A'){
		console.log('WA');
		return 0;
	}
	if(s[1]!==s[1].toLowerCase() || s[n-1]!==s[n-1].toLowerCase()){
		console.log('WA');
		return 0;
	}
	for(var i = 2; i < n-1; i++){
		if(s[i]!==s[i].toLowerCase()){
			if(s[i]==='C'){
				if(isC===1){
					console.log('WA');
					return 0;
				}else{
					isC++;
				}
			}else{
				console.log('WA');
				return 0;
			}
		}
	}
	if(isC===0){
		console.log('WA');
	}else{
		console.log('AC');
	}
}