function Main(input) {
    if (input[0] !== 'A') {
        console.log('WA');
        return;
    }

    var str = input.slice(2, -1);
    var s = str.indexOf('C', 0);
    if (s === -1 && str.split('C').length === 2) {
        console.log('WA');
        return;
    }

    var str1 = input.slice(1, 2);
    var str2 = str.replace('C', '');
    var str3 = input.slice(-1);
    var hoge = str1 + str2 + str3;

    if (hoge.match(/^[a-z]+$/)) {
        console.log('AC');
        return;
    }
    console.log('WA');
}

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