import Foundation

var s = readLine()!
var ans = "AC"
if s[s.startIndex] != "A" { ans = "WA" }
let start = s.index(s.startIndex, offsetBy: 2)
let end = s.index(s.endIndex, offsetBy: -2)
var count = 0
for (i, c) in s[start...end].enumerated() {
  if c == "C" {
    count += 1
    s.remove(at: s.index(s.startIndex, offsetBy: i + 2))
  }
}
s.removeFirst()
if count != 1 { ans = "WA" }
if s.lowercased() != s { ans = "WA" }
print(ans)