import sys

s = eval(input())

ans = 'AC'

c = 0

if s[0] != 'A':

    ans = "WA"

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

    if "C" == s[i]:

        c += 1

if c != 1:

    ans = "WA"

c = 0

for i in range(len(s)):

    a = ord(s[i])

    if 65 <= a and a <= 96:

        c += 1

if c != 2:

    ans = "WA"

print(ans)
s = eval(input())

ans = 'AC'

if s[0] != 'A':

    ans = 'WA'

if not('C' in s[2:-1]):

    ans = 'WA'

s = s.replace('A','')

s = s.replace('C','',1)

for i in s:

    if ord(i) < ord('a') or ord(i) > ord('z'):

        ans = 'WA'

print(ans)

import sys

s = eval(input())
ans = "AC"
c = 0
if s[0] != "A":
    ans = "WA"
for i in range(2, len(s) - 1):
    if "C" == s[i]:
        c += 1
if c != 1:
    ans = "WA"
c = 0
for i in range(len(s)):
    a = ord(s[i])
    if 65 <= a and a <= 96:
        c += 1
if c != 2:
    ans = "WA"
print(ans)

s = eval(input())
ans = "AC"
if s[0] != "A":
    ans = "WA"
if not ("C" in s[2:-1]):
    ans = "WA"
s = s.replace("A", "")
s = s.replace("C", "", 1)
for i in s:
    if ord(i) < ord("a") or ord(i) > ord("z"):
        ans = "WA"
print(ans)

-import sys - -c = 0 -for i in range(2, len(s) - 1): -    if "C" == s[i]: -        c += 1 -if c != 1: +if not ("C" in s[2:-1]): -c = 0 -for i in range(len(s)): -    a = ord(s[i]) -    if 65 <= a and a <= 96: -        c += 1 -if c != 2: -    ans = "WA" +s = s.replace("A", "") +s = s.replace("C", "", 1) +for i in s: +    if ord(i) < ord("a") or ord(i) > ord("z"): +        ans = "WA"