function main(arg) {
    // 処理

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