function Main(input) {
  var s = input[0]

  if (s[0] != 'A') {
    console.log('WA')
    return
  } else {
    s = s.substr(1)
  }

  var i = s.slice(1, -2).indexOf('C')
  if (i != -1) {
    console.log('WA')
    return
  } else {
    s = s.replace('C', '')
  }


  if (s.match(/^[a-z]*/)) {
    console.log('AC')
  } else {
    console.log('WA')
  }
}


Main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n'))
