s = eval(input())

cnt = 0

for i in range(len(s)):

    if i == 0:

        if s[i] != "A":

            print("WA")

            exit()

    else:

        if s[i] == "C" and 2 <= i <= len(s) - 2:

            cnt += 1

        else:

            if s[i] != s[i].lower():

                print("WA")

                exit()

if cnt == 1:

    print("AC")

else:

    print("WA")

s = eval(input())

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

    for i in range(len(s)):

        if s[i] != "A" and s[i] != "C":

            if s[i] != s[i].lower():

                print("WA")

                exit()

    print("AC")

else:

    print("WA")

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

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

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