s = eval(input())

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

    s1 = s.replace("A","a", 1)

    s2 = s[2:-1].replace("C","c")

    s = s1[:2] + s2 + s1[-1]

    if s.islower() == True:

        print("AC")

    else:

        print("WA")

else:

    print("WA")
s = eval(input())

part_of_s = s[2:-1]

sub_s = s.replace('A','')

sub_s = sub_s.replace('C','')



if s[0] != 'A' or part_of_s.count('C') != 1 or sub_s != sub_s.lower():

    print('WA')

    exit()



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

s = eval(input())
part_of_s = s[2:-1]
sub_s = s.replace("A", "")
sub_s = sub_s.replace("C", "")
if s[0] != "A" or part_of_s.count("C") != 1 or sub_s != sub_s.lower():
    print("WA")
    exit()
print("AC")

-if s.find("A") == 0 and s[2:-1].count("C") == 1: -    s1 = s.replace("A", "a", 1) -    s2 = s[2:-1].replace("C", "c") -    s = s1[:2] + s2 + s1[-1] -    if s.islower() == True: -        print("AC") -    else: -        print("WA") -else: +part_of_s = s[2:-1] +sub_s = s.replace("A", "") +sub_s = sub_s.replace("C", "") +if s[0] != "A" or part_of_s.count("C") != 1 or sub_s != sub_s.lower(): +    exit() +print("AC")