fun main(arr:Array<String>) {
    val s = readLine()!!
    println(if(isAc(s)) "AC" else "WA")
}


fun isAc(s:String):Boolean {
    if(s[0] != 'A') {
        return false
    }
    if(s.substring(2 until s.length-1).count { it == 'C' } != 1) {
        return false
    }
    if(s.count { it == 'C' } != 1) {
        return false
    }
    if(s.substring(1).filter { it != 'C' }.all { it in ('a'..'z') }) {
        return true
    }
    return false
}