var lines = [];

var readline = require('readline');
var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
})

rl.on('line', function (x) {
    lines.push(x);
});

rl.on("close", function () {
    var S = lines[0].split("");
    if (S[0] !== "A") { console.log("WA"); return (0); }
    if (S[1] !== S[1].toLowerCase()) { console.log("WA"); return (0) }

    var counter = 0;
    for (var i = 2; i < S.length - 1; i++) {

        if (S[i] === "C") { counter++; S[i] = "c"; }
        if (1 < counter) { console.log("WA"); return (0); }
        if (S[i] !== S[i].toLowerCase()) { console.log("WA"); return (0); }

    }
    if (counter === 0) {console.log("WA"); return (0) }
    if (S[S.length - 1] !== S[S.length - 1].toLowerCase()) { console.log("WA"); return (0) }

    console.log("AC");
});