function Main(s) { 
    if (s[0].indexOf('A') === -1) {
        console.log('WA');
        return;
    }
    
    var cnt = 0;
    for (var i = 1 ; i < s.length ; ++i) {
        if (s[i].charCodeAt(0) > 64 && s[i].charCodeAt(0) < 91) {
            if (i === 1 || i === s.length - 1 || s[i].indexOf('C') === -1) {
                console.log('WA');
                return;
            }
            ++cnt;
        }
    }
    if (cnt !== 1) {
        console.log('WA');
        return;
    }
    console.log('AC');
}

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