read s;
c=0;
for i in `seq 2 ${#s}`;do
	if echo ${s:$[i-1]:1}|grep -cq "[A-Z]";then
		if [ ${s:$[i-1]:1} = "C" ];then
			c=$[c+1];
		else
			c=$[c+2];
		fi
	fi
done;
if [ $c -ne 1 -o ${s:0:1} != "A" ]||(echo ${s:1:1}|grep -cq "[A-Z]")||(echo ${s:$[${#s}-1]:1}|grep -cq "[A-Z]");then
	echo "WA";
else
	echo "AC";
fi
