S = list(eval(input()))



ans = "AC"

tmp = S[2:-1]



if S[0] != "A":

  ans = "WA"

else:

  S.remove("A")

  

count = 0

for item in tmp:

  if item == "C":

    count += 1

    

if count != 1:

  ans = "WA"

elif count == 1:

  S.remove("C")





if "".join(S).lower() != "".join(S):

  ans = "WA"



print(ans)
S = eval(input())



ans = "AC"

tmp = S[2:-1]



if S[0] != "A":

  ans = "WA"

else:

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

  

count = 0

for item in tmp:

  if item == "C":

    count += 1

    

if count != 1:

  ans = "WA"

elif count == 1:

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



if not S.islower():

  ans = "WA"



print(ans)
S = list(eval(input()))
ans = "AC"
tmp = S[2:-1]
if S[0] != "A":
    ans = "WA"
else:
    S.remove("A")
count = 0
for item in tmp:
    if item == "C":
        count += 1
if count != 1:
    ans = "WA"
elif count == 1:
    S.remove("C")
if "".join(S).lower() != "".join(S):
    ans = "WA"
print(ans)

S = eval(input())
ans = "AC"
tmp = S[2:-1]
if S[0] != "A":
    ans = "WA"
else:
    S = S.replace("A", "")
count = 0
for item in tmp:
    if item == "C":
        count += 1
if count != 1:
    ans = "WA"
elif count == 1:
    S = S.replace("C", "")
if not S.islower():
    ans = "WA"
print(ans)

-S = list(eval(input())) +S = eval(input()) -    S.remove("A") +    S = S.replace("A", "") -    S.remove("C") -if "".join(S).lower() != "".join(S): +    S = S.replace("C", "") +if not S.islower():