s = eval(input())

if s[0] != 'A':

    print('WA')

    exit()



import collections

cnt = collections.Counter(s[2:-1])

if cnt['C'] != 1:

    print('WA')

    exit()



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

if not s2.islower():

    print('WA')

    exit()



print('AC')







s = eval(input())

if s[0] != 'A':

    print('WA')

    exit()



if s.count('C', 2, -1) != 1:

    print('WA')

    exit()



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

if not s2.islower():

    print('WA')

    exit()



print('AC')







s = eval(input())
if s[0] != "A":
    print("WA")
    exit()
import collections

cnt = collections.Counter(s[2:-1])
if cnt["C"] != 1:
    print("WA")
    exit()
s2 = s[1:].replace("C", "")
if not s2.islower():
    print("WA")
    exit()
print("AC")

s = eval(input())
if s[0] != "A":
    print("WA")
    exit()
if s.count("C", 2, -1) != 1:
    print("WA")
    exit()
s2 = s[1:].replace("C", "")
if not s2.islower():
    print("WA")
    exit()
print("AC")

-import collections - -cnt = collections.Counter(s[2:-1]) -if cnt["C"] != 1: +if s.count("C", 2, -1) != 1: