import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;


void main()
{
  auto s = readln.chomp;
  bool f;
  if (s[0] != 'A') {
    f = true;
  }
  if (!(s[1] >= 'a' && s[1] <= 'z')) {
    f = true;
  }
  if (!(s[$-1] >= 'a' && s[$-1] <= 'z')) {
    f = true;
  }
  auto c_num = s[2..$-1].count!(x=>x == 'C');
  auto s_num = s[2..$-1].count!(x=>x>='a' && x<='z');

  if (c_num != 1) {
    f = true;
  }
  if (s_num != s[2..$-1].length.to!int - 1) {
    f = true;
  }

  if (f) {
    writeln("WA");
  } else {
    writeln("AC");
  }
}
