function main(arg) {
    // 処理
  	arg = arg.split("\n")
  	arg = arg[0]
  	if (arg[0] !== 'A') {
        console.log('WA')
        return
    }

    var top = arg.slice(0,2)
    var tmp = arg.slice(2, -1)
    var bot = arg.slice(-1)

    if (!tmp.split("C").length === 2) {
        console.log('WA')
        return
    }

    top = top.split()
    top[0] = 'a'
    top.join('')

    tmp = tmp.split("C").join("c")

    var text = top + tmp + bot
    for (var i = 0;i < text.length; i++ ){
        if (text[i].search(/[a-z]/) == -1 ){
            console.log('WA')
            return
        }
    }
    console.log('AC')
    return
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
