S = eval(input())

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

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

    if S.islower():

        print('AC')

    else:

        print('WA')

else:

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

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

    i = S.index('C')

    jj = S[1:i]+S[i+1:]

    if jj.islower() == True:

        print('AC')

    else:

        print('WA')

else:

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

S = eval(input())
if S[0] == "A" and S[2:-1].count("C") == 1:
    i = S.index("C")
    jj = S[1:i] + S[i + 1 :]
    if jj.islower() == True:
        print("AC")
    else:
        print("WA")
else:
    print("WA")

-if S[0] == "A" and "C" in S[2:-1] and S.count("C") == 1: -    S = S[1:].replace("C", "") -    if S.islower(): +if S[0] == "A" and S[2:-1].count("C") == 1: +    i = S.index("C") +    jj = S[1:i] + S[i + 1 :] +    if jj.islower() == True: