import std.stdio;
import std.ascii;
import std.conv;
import std.string;
import std.algorithm;
import std.range;
import std.functional;
import std.math;
import core.bitop;

void main()
{
    auto i = readln.chomp;
    if (i[0] != 'A')
    {
        "WA".writeln;
        return;
    }
    if (i[1].isUpper || i[$ - 1].isUpper)
    {
        "WA".writeln;
        return;
    }
    long cntc;
    foreach (c; i[2 .. $ - 1])
    {
        if (c == 'C')
        {
            cntc++;
        }
        if (c.isUpper && c != 'C')
        {
            "WA".writeln;
            return;
        }
    }
    if (cntc != 1)
    {
        "WA".writeln;
        return;
    }
    "AC".writeln;
}
