fun main(args: Array<String>) {
    val S = readLine()!!
    if (!S.startsWith("A")) {
        println("WA")
        return
    }

    if (S.substring(2, S.length - 1).count { it == 'C' } != 1) {
        println("WA")
        return
    }

    if (!(S.count { it == 'C' } == 1 && S.count { it == 'A' } == 1)) {
        println("WA")
        return
    }

    if (S.filter { it.isLowerCase() }.count() != S.count() - 2) {
        println("WA")
        return
    }

    println("AC")
}
