S = eval(input())



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

    S=S.replace("A", "a")

    S=S.replace("C", "c")

    if S.islower()==True:

        print('AC')

    else:

        print('WA')

else:

    print('WA')
S = eval(input())



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

    S=S[1:].replace("C", "c")

    if S.islower()==True:

        print('AC')

    else:

        print('WA')

else:

    print('WA')
S = eval(input())
if S[0] == "A" and S[2:-1].count("C") == 1:
    S = S.replace("A", "a")
    S = S.replace("C", "c")
    if S.islower() == True:
        print("AC")
    else:
        print("WA")
else:
    print("WA")

S = eval(input())
if S[0] == "A" and S[2:-1].count("C") == 1:
    S = S[1:].replace("C", "c")
    if S.islower() == True:
        print("AC")
    else:
        print("WA")
else:
    print("WA")

-    S = S.replace("A", "a") -    S = S.replace("C", "c") +    S = S[1:].replace("C", "c")