function main(arg) {
    // 処理

    if (arg[0] === 'A') {
        arg[0] = 'a'
        var top = arg.slice(0,2)
        var tmp = arg.slice(2, -2)
        var bot = arg.slice(-2)
        if (tmp.split("C").length === 2) {
            var text = top + tmp.split("C").join("c") + bot
            if (!text.match(/^[A-Z]+$/) || arg.length === 4){
                console.log('AC')
                return
            }
        }
    }
    console.log('WA')
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));