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()

num=0

for i in range(N) :

    if S[i]>='A' and S[i]<='Z':

        num+=1

if num!=2:

    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()
num = 0
for i in range(N):
    if S[i] >= "A" and S[i] <= "Z":
        num += 1
if num != 2:
    print("WA")
    sys.exit()
print("AC")

+num = 0 -    if S[i] in "AC": -        continue -    if S[i].isupper(): -        print("WA") -        sys.exit() +    if S[i] >= "A" and S[i] <= "Z": +        num += 1 +if num != 2: +    print("WA") +    sys.exit()