function main(arg) {
    // 処理

    if (arg[0] === 'A' && arg[1] !== 'C') {
        arg[0] = 'a'
        if (arg.slice(2, -2).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'));