function Main(input) {
    var lines = input.split('\n');
    var words = lines[0].split('');
    var ans = 'WA';

    if (words[0] == 'A') {
        for (var i = 2; i < words.length - 1; i++) {
            if (words[i] == 'C') {
                words.shift();
                words.splice(i - 1, 1);
                if (words.join('').match(/^[a-z]+$/)) {
                    ans = 'CA';
                }
            }
        }
    }
    
    console.log(ans);
}

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