read s

if [ ${s:0:1} != 'A' ] ; then
    echo "WA" && exit
fi

flag=0

for (( i = 2; i < ${#s}-1; i++ )) do
    if [ ${s:$i:1} == 'C' ] ; then
        flag=1
    fi
done

if [ $flag != 1 ] ; then
    echo "WA" && exit
fi

count=0

for (( i = 0; i < ${#s}; i++ )) do
    if [ $(echo ${s:$i:1} | awk '/[A-Z]/') ] ; then
        count=$((count+=1))
    fi
done

if [ $count != 2 ] ; then
    echo "WA"
else
    echo "AC"
fi