s = eval(input())

chrs = 'abcdefghijklmnopqrstuvwxyz'



p1 = (s[0] == 'A')

p2 = (s[2:-1].count('C') == 1)

p4 = (s[1] in chrs)

p5 = (s[-1] in chrs)



p3 = True

C_found = False

for i in range(2, len(s) - 1):

    if not(s[i] in chrs):

        if (s[i] == 'C'):

            if C_found:

                p3 = False

                break

            else:

                C_found = True

        else:

            p3 = False

            break

        

if p1 and p2 and p3 and p4 and p5 and C_found:

    print('AC')

else:

    print('WA')
def check(s):

    if (s[0] != 'A'): return False

    

    c = 0

    for i in range(2, len(s) - 1):

        if (s[i] == 'C'):

            c += 1

    if c != 1: return False



    upper = 0

    for i in range(len(s)):

        if ('A' <= s[i] <= 'Z'):

            upper += 1

    if upper != 2: return False

    return True



S = eval(input())

print(('AC' if check(S) else 'WA'))
s = eval(input())
chrs = "abcdefghijklmnopqrstuvwxyz"
p1 = s[0] == "A"
p2 = s[2:-1].count("C") == 1
p4 = s[1] in chrs
p5 = s[-1] in chrs
p3 = True
C_found = False
for i in range(2, len(s) - 1):
    if not (s[i] in chrs):
        if s[i] == "C":
            if C_found:
                p3 = False
                break
            else:
                C_found = True
        else:
            p3 = False
            break
if p1 and p2 and p3 and p4 and p5 and C_found:
    print("AC")
else:
    print("WA")

def check(s):
    if s[0] != "A":
        return False
    c = 0
    for i in range(2, len(s) - 1):
        if s[i] == "C":
            c += 1
    if c != 1:
        return False
    upper = 0
    for i in range(len(s)):
        if "A" <= s[i] <= "Z":
            upper += 1
    if upper != 2:
        return False
    return True


S = eval(input())
print(("AC" if check(S) else "WA"))

-s = eval(input()) -chrs = "abcdefghijklmnopqrstuvwxyz" -p1 = s[0] == "A" -p2 = s[2:-1].count("C") == 1 -p4 = s[1] in chrs -p5 = s[-1] in chrs -p3 = True -C_found = False -for i in range(2, len(s) - 1): -    if not (s[i] in chrs): +def check(s): +    if s[0] != "A": +        return False +    c = 0 +    for i in range(2, len(s) - 1): -            if C_found: -                p3 = False -                break -            else: -                C_found = True -        else: -            p3 = False -            break -if p1 and p2 and p3 and p4 and p5 and C_found: -    print("AC") -else: -    print("WA") +            c += 1 +    if c != 1: +        return False +    upper = 0 +    for i in range(len(s)): +        if "A" <= s[i] <= "Z": +            upper += 1 +    if upper != 2: +        return False +    return True + + +S = eval(input()) +print(("AC" if check(S) else "WA"))