import re

S = eval(input())

flag_1 = False

flag_2 = False

flag_3 = False



if S[0] == 'A': flag_1 = True

if S[2:-1].count('C') == 1: flag_2 = True



if flag_1 == True and flag_2 == True:

   if len(re.findall('[A-Z]', S)) == 2:

       flag_3 = True



if flag_1 == True and flag_2 == True and flag_3 == True:

    print('AC')

else:

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

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

    print('AC')

else:

    print('WA')
import re

S = eval(input())
flag_1 = False
flag_2 = False
flag_3 = False
if S[0] == "A":
    flag_1 = True
if S[2:-1].count("C") == 1:
    flag_2 = True
if flag_1 == True and flag_2 == True:
    if len(re.findall("[A-Z]", S)) == 2:
        flag_3 = True
if flag_1 == True and flag_2 == True and flag_3 == True:
    print("AC")
else:
    print("WA")

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

-import re - -flag_1 = False -flag_2 = False -flag_3 = False -if S[0] == "A": -    flag_1 = True -if S[2:-1].count("C") == 1: -    flag_2 = True -if flag_1 == True and flag_2 == True: -    if len(re.findall("[A-Z]", S)) == 2: -        flag_3 = True -if flag_1 == True and flag_2 == True and flag_3 == True: +if S[0] == "A" and S[2:-1].count("C") == 1 and S[1:].replace("C", "", 1).islower():