s = eval(input())

cnt = 0

if s[0] == "A" and s[2:-1].count("C") == 1:

    for i in range(len(s)):

        if ord(s[i])<=90:

            cnt += 1

    if cnt != 2:

        print("WA")

        quit()

    else:

        print("AC")

else:

    print("WA")

s = eval(input())

cnt = 0

if s[0] == "A" and s[2:-1].count("C") == 1:

    for i in range(len(s)):

        if ord(s[i])<=90:

            cnt += 1

    if cnt != 2:

        print("WA")

    else:

        print("AC")

else:

    print("WA")

s = eval(input())
cnt = 0
if s[0] == "A" and s[2:-1].count("C") == 1:
    for i in range(len(s)):
        if ord(s[i]) <= 90:
            cnt += 1
    if cnt != 2:
        print("WA")
        quit()
    else:
        print("AC")
else:
    print("WA")

s = eval(input())
cnt = 0
if s[0] == "A" and s[2:-1].count("C") == 1:
    for i in range(len(s)):
        if ord(s[i]) <= 90:
            cnt += 1
    if cnt != 2:
        print("WA")
    else:
        print("AC")
else:
    print("WA")

-        quit()