import re



s = eval(input())





if re.match(r'A[a-z]+C[a-z]+\Z',s) == None:

  print("WA")

else:

  print("AC")
import re



S = eval(input())



if S[0] != 'A':

  print('WA')

  exit()



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

  print('WA')

  exit()



if re.match(r'A[a-z]+C[a-z]+\Z', S) == None:

  print('WA')

  exit()



print('AC')

import re

s = eval(input())
if re.match(r"A[a-z]+C[a-z]+\Z", s) == None:
    print("WA")
else:
    print("AC")

import re

S = eval(input())
if S[0] != "A":
    print("WA")
    exit()
if S[2:-1].count("C") != 1:
    print("WA")
    exit()
if re.match(r"A[a-z]+C[a-z]+\Z", S) == None:
    print("WA")
    exit()
print("AC")

-s = eval(input()) -if re.match(r"A[a-z]+C[a-z]+\Z", s) == None: +S = eval(input()) +if S[0] != "A": -else: -    print("AC") +    exit() +if S[2:-1].count("C") != 1: +    print("WA") +    exit() +if re.match(r"A[a-z]+C[a-z]+\Z", S) == None: +    print("WA") +    exit() +print("AC")