import sys

S=eval(input())

N=len(S)

L=['B','D','E','F','G','H','I','J','K','L','N','M','O','P','Q','R','S','T','U','V','W','X','Y','Z']

if S[0]!='A':

    print('WA')

    sys.exit()

ans=0

for i in range(2,N-1) :

    if S[i]=='C':

        ans+=1

if ans!=1:

    print('WA')

    sys.exit()

for i in range(N) :

    if S[i] in L:

        print('WA')

        sys.exit()

print('AC')
import sys

S=eval(input())

N=len(S)

#L=['B','D','E','F','G','H','I','J','K','L','N','M','O','P','Q','R','S','T','U','V','W','X','Y','Z']

if S[0]!='A':

    print('WA')

    sys.exit()

ans=0

for i in range(2,N-1) :

    if S[i]=='C':

        ans+=1

if ans!=1:

    print('WA')

    sys.exit()

for i in range(N) :

    if S[i] in 'AC':

        continue

    if S[i].isupper():

        print('WA')

        sys.exit()

print('AC')
import sys

S = eval(input())
N = len(S)
L = [
    "B",
    "D",
    "E",
    "F",
    "G",
    "H",
    "I",
    "J",
    "K",
    "L",
    "N",
    "M",
    "O",
    "P",
    "Q",
    "R",
    "S",
    "T",
    "U",
    "V",
    "W",
    "X",
    "Y",
    "Z",
]
if S[0] != "A":
    print("WA")
    sys.exit()
ans = 0
for i in range(2, N - 1):
    if S[i] == "C":
        ans += 1
if ans != 1:
    print("WA")
    sys.exit()
for i in range(N):
    if S[i] in L:
        print("WA")
        sys.exit()
print("AC")

import sys

S = eval(input())
N = len(S)
# L=['B','D','E','F','G','H','I','J','K','L','N','M','O','P','Q','R','S','T','U','V','W','X','Y','Z']
if S[0] != "A":
    print("WA")
    sys.exit()
ans = 0
for i in range(2, N - 1):
    if S[i] == "C":
        ans += 1
if ans != 1:
    print("WA")
    sys.exit()
for i in range(N):
    if S[i] in "AC":
        continue
    if S[i].isupper():
        print("WA")
        sys.exit()
print("AC")

-L = [ -    "B", -    "D", -    "E", -    "F", -    "G", -    "H", -    "I", -    "J", -    "K", -    "L", -    "N", -    "M", -    "O", -    "P", -    "Q", -    "R", -    "S", -    "T", -    "U", -    "V", -    "W", -    "X", -    "Y", -    "Z", -] +# L=['B','D','E','F','G','H','I','J','K','L','N','M','O','P','Q','R','S','T','U','V','W','X','Y','Z'] -    if S[i] in L: +    if S[i] in "AC": +        continue +    if S[i].isupper():