peterverebics/CodeNet_Python_118 huggingface dataset:
s = input()
l = []
for i in s:
  l.append(i)
if l[0] != "A":
  print("WA")
else:
  if len(l) == 3:
    if l[1].islower() and l[2] == "C":
      print("AC")
    else:
      print("WA")
  else:
    l.remove("A")
    if "C" not in l[1:len(l)-1]:
      print("WA")
    else:
      l.remove("C")
      s = "".join(l)
      if s.islower():
        print("AC")
      else:
        print("WA")
s=input()
x=0
if s[0]=="A" and s[1]!="C" and s[-1]!="C":
    for i in range(len(s)):
        if s.count("C")==1:
            if s[i].isupper():
                x+=1
        else:
            print("WA")
            exit()
    if x==2:
        print("AC")
    else:
        print("WA")

else:
    print("WA")
# solution
import io

data=input()
if data[0]=="A"and data[2:-1].count("C")==1\
and data[1:].replace("C","c",1).islower()==True:
    print("AC")
else:print("WA")
S = input()
if S[0]=='A' and (S[2:len(S)-1].count('C')==1) and S[1:2].islower() and S[len(S)-1:].islower():
  print('AC')
else:
  print('WA')
s=list(input())
swi=1
if s[0]=="A":
    if "C" in s[2:-1]:
        s=s[1:]
        s.remove("C")
        swi=0
        for i in range(len(s)):
            if not s[i].islower():
                swi=1
print("AC" if swi==0 else "WA")
s = input()

a = -1
c = -1
lower = 0
for i in range(len(s)):
  if s[i] == 'A':
    a = i
  if s[i] == 'C':
    c = i
  if 'a' <= s[i] <= 'z':
    lower += 1

if a == 0 and 2 <= c <= len(s) - 2 and lower == len(s) - 2:
  print('AC')
else:
  print('WA')
s = input()

if s[0] == "A":
    if s[2:-1].count("C") == 1:
        if s[1:].replace("C","").islower():
            print("AC")
            exit()
print("WA")
s = list(input())
flag = 1
if s[0] == "A" :
    if s[2:-1].count("C") == 1 :
        for i in range(1,len(s)) :
            if i != s[2:-1].index("C") + 2 :
                if s[i] != s[i].lower() :
                    flag = 0
                    break
    else :
        flag = 0
else :
    flag = 0

print("AC" if flag ==1 else "WA")
"""
1. The initial character of S is an uppercase A.
2. There is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).
3. All letters except the A and C mentioned above are lowercase.
"""
import collections
def a(r): return r[0] == 'A'
def b(r): return collections.Counter(r[2:-1])['C'] == 1
def c(r): return all([l in set(['A', 'C']) or l.lower() ==l for l in r ])
def f(r):  return a(r) and b(r) and c(r)

print 'AC' if f(raw_input()) else 'WA'
S=input()
if S[0]=='A' and S.count('C')==1 and 'C' in S[2:-1]:
    for c in S[1:len(S)]:
        if not (c.islower() or c=='C'):
            print("WA")
            break
    else:
        print("AC")
else:
    print("WA")
import numpy as np

def main():

    test = input()
    if test[0] != "A":
        print("WA")
        return

    if test[:-1][2:].count("C") != 1:
        print("WA")
        return

    for i in range(len(test)):
        if i == 0 and test[i] == "A": continue
        if 2 <= i <= len(test) - 2 and test[i] == "C": continue

        if test[i].lower() != test[i]:
            print("WA")
            return

    print("AC")







if __name__ == "__main__":
    main()
s=input()
ans=0
count=0
t=""
if s[0]=="A":
  ans+=1
for i in range(2,len(s)-1):
  # print(s[i])
  if s[i]=="C":
    count+=1
    t=s[1:i]+s[i+1:]	
# print(t)
if t.islower()==True and ans==1 and count==1:
  print("AC")
else:
  print("WA")
S = input()
f = True
if S[0] != 'A':
  f = False
elif S[2:-1].count('C') != 1:
  f = False
else:
  for s in S[1:]:
    if s not in 'Cabcdefghijklmnopqrstuvwxyz':
      f = False
      break
print('AC' if f else 'WA')
S = list(input())

if S[0] != "A":
  print("WA")
elif S[2:-1].count("C") != 1:
  print("WA")
elif sum([s.islower() for s in S])+2 != len(S):
  print("WA")
else:
  print("AC")
import re

print ('AC' if re.match(r'\AA[a-z](?:[a-z]*C[a-z]*)[a-z]\Z', input()) else 'WA')
S = str(input())

a=0
b=0
c=0
if S[0]=='A':
    a=1

cnt=0
for i in S[2:-1]:
    if i=='C':
        cnt+=1
if cnt==1:
    b=1

s=S[1:]
s=s.replace('C','')
if s.islower()==True:
    c=1

if a==1 and b==1 and c==1:
    print('AC')
else:
    print('WA')
s=input()

if s[0] !="A":
    print("WA")
    exit()

cnt=0
for i in range(2,len(s)-1):
   if s[i] == "C":
       cnt+=1
if cnt!=1:
    print("WA")
    exit()

for i in range(1,len(s)):
    if s[i] == "C" and 2<=i<len(s)-1:
        continue
    if not s[i].islower():
        print("WA")
        exit()
print("AC")
s=input()
cnt=0
if s[0] != 'A':
    print('WA')
    exit()
if s[2:len(s)-1].count('C') != 1:
    print('WA')
    exit()
else:
    for i in range(1,len(s)):
        if s[i]=='C':
            continue
        if s[i].isupper():
            print('WA')
            exit()

print('AC')
# coding: utf-8

s = input().rstrip()

def isValid(s:str):
    if s[0] != "A":
        return False
    if s[1] == s[1].upper():
        return False
    sub = s[2:-1]
    if len([i for i in sub if i == "C"]) != 1:
        return False

    sub2 = s[1] + sub.replace("C", "") + s[-1]
    if sub2 != sub2.lower():
        return False
    return True

ans = "AC"

if not isValid(s):
    ans = "WA"

print(ans)
s = list(map(str,input()))
if s[0] != "A":
  print("WA")
elif s[2:-1].count("C") != 1:
  print("WA")
else:
  del s[0]
  s.remove("C")
  if "".join(s).islower():
    print("AC")
  else:
    print("WA")
s=input()
a=s.lower()
l=len(s)
count=0
dif=0

if s[0]=='A':
  for i in range(2,l-1):
    if s[i]=='C':
      count+=1
  if count==1:
    for i in range(1,l):
      if s[i]!=a[i]:
        dif+=1
    if dif==1:
      print('AC')
      exit()
print('WA')
s = input()
flag = False

if s[0]=="A":
	if s[2:-1].count("C")==1:
		if (s[1:s.index("C")].islower() and s[s.index("C")+1:].islower()):
			flag = True
print("AC" if flag else "WA")
S = input()

ans_1 = S[0]=="A"
ans_2 = S[2:-1].count("C")==1
S = S[1:].replace("C", "")
ans_3 = S.islower()

print("AC") if ans_1 & ans_2 & ans_3 else print("WA")
def resolve():
    S = input()
    if S[0] == "A" and S[2:-1].count("C") == 1:
        if S.count("A") == 1 and S.count("C") == 1:
            S = S.replace("A", "").replace("C", "")
            if S == S.lower():
                print("AC")
                return
    print("WA")


resolve()
s = input()
flg1 = s[0] == "A"
flg2 = s[2:-1].count("C") == 1
s = s.replace("A", "")
s = s.replace("C", "")
flg3 = s.islower()
print(["WA", "AC"][flg1 and flg2 and flg3])
A= input()
if A[0]=="A" and A[2:-1].count("C")==1:
    pass
else:
    print("WA")
    exit()
B=A[1:]
B=B.replace("C","")
if B.islower()==True:
    print("AC")
else:
    print("WA")
S = input()
count=0
if S[0]=="A":
  for i in range(2,max([len(S)-1,3]),1):
    if S[i]=="C":
      count+=1
      idx=i
  if count==1:
    s=S[1:idx]+S[idx+1:]
    if s==s.lower():
      print("AC")
    else:
      print("WA")
  else:
    print("WA")
else:
  print("WA")
s=input()
res="AC"
if s[0]!="A":res="WA"
elif s[2:-1].count("C")!=1:res="WA"
else:
    li=list(s)
    li.remove("A")
    li.remove("C")
    for i in li:
        if i!=i.lower():
            res="WA"
print(res)
s = input()
if s[0] != 'A':
  print('WA')
  exit()
sho = ord('a')
ok = 0
for i in s[2: len(s) - 1]:
  if ord(i) < sho:
    if ord(i) == ord("C"):
      ok += 1
    else:
      print("WA")
      exit()
if ord(s[1]) < sho or ord(s[len(s) - 1]) < sho:
  print("WA")
  exit()
if ok == 1:
  print("AC")
else:
  print("WA")
S = input()

ans = "WA"

if S[0] != "A":
  print(ans)
  
else:
  if S[2:len(S) - 1].count("C") != 1:
    print(ans)
  else:
    s = S.index("C")
    SS = S[1:s] + S[s + 1:]
    if SS.islower() == False:
      print(ans)
    else:
      print("AC")
s = input().strip()
a = (s[0] == "A")
c_cnt = 0
for e in s[2:(-1)]:
    if e == "C":
        c_cnt += 1
if a and c_cnt == 1 and s[1:].replace("C", "").islower():
    print("AC")
else:
    print("WA")
import sys

s=input()
c_count=0
flag=False


for ss in s:
    if ss.isupper():
        if ss!='A' and ss!='C':
            print('WA')
            sys.exit()

if s[0]=='A':
    for i in range(2,len(s)-1):
        if s[i]=='C':
            c_count+=1

if c_count==1:
    flag=True

if flag:
    print("AC")
else:
    print("WA")
S = input()
check = False
if S[0] == "A" and "C" in S[2:-1]:
  i = list(S).index("C")
  T = S[1:i] + S[i+1:]
  if T == T.lower():
    check = True
    
print("AC" if check else "WA")
S = list(map(str, input()))
flg = 1

if S[0] != "A":
	flg = 0

ctr = 0
for i in range(2, len(S) - 1):
	if S[i] == "C":
		ctr += 1
if ctr != 1:
	flg = 0

ctr = 0	
for s in S:
	if ord(s) <= 90:
		ctr += 1
if ctr != 2:
	flg = 0
	
	
if flg:
	print("AC")
else:
	print("WA")
S = input()
Flag = False
if (S[0]=='A') and S[2:len(S)-1].count('C')==1:
    ReS = S.replace('C','')[1:]
    if ReS.islower():
        Flag = True
if Flag:
    print('AC')
else:
    print('WA')
S = input()
if S[0] == 'A':
    if S[1] != 'C' and S[-1] != 'C':
        if S.count('C') == 1:
            S = S.lstrip('A')
            S = S.replace('C','c')
            if S.islower():
                print("AC")
                exit(0)
 
print('WA')
s = input()
flg = 1
if (s[0] != 'A'):
    flg = 0
cnt = 0
for i in s[2:-1]:
    if (i == 'C'): cnt+= 1
if (cnt != 1):
    flg = 0 

cap = 0
for i in s:
    if ('A' <= i <= 'Z'): cap += 1
if (cap != 2):
    flg = 0
if (flg): print("AC")
else: print("WA")
import re
print('AC') if re.match(r'A[a-z]+C[a-z]+$',input()) else print('WA')
a = ord('a')
z = ord('z')
S = input()

ans = 'WA'
if S[0] == 'A':
    if S[2:-1].count('C') == 1:
        for i, c in enumerate(S):
            if i == 0 or c == 'C':
                continue
            else:
                if a <= ord(c) <= z:
                    continue
                else:
                    break
        else:
            ans = 'AC'

print(ans)
ans = True
key = 0
s = input()

for i in range(len(s)):
  if i == 0 and s[0] != "A":
    ans = False
  if (i == 1 or i == len(s)-1) and s[i].isupper():
    ans = False
  if 2 <= i <= len(s)-2:
    if s[i] == "C":
      key += 1
    elif s[i].isupper():
      ans = False
if key == 1 and ans:
  print("AC")
else:
  print("WA")
S = list(input())

ans = 'AC'
if S[0] == 'A':
    del S[0]
    for i in range(1, len(S)-1):
        if S[i] == 'C':
            del S[i]
            ans = 'AC'
            break
        else:
            ans = 'WA'
    for j in range(len(S)):
        if S[j].isupper():
            ans = 'WA'
else:
    ans = 'WA'
print(ans)
s = list(input())
ans = 'AC'
if s[0] != 'A':
    ans = 'WA'
c_idx = None
for i, v in enumerate(list(s)):
    if i >= 2 and i <= len(s)-2:
        if v == 'C':
            if c_idx is None:
                c_idx = i
            else:
                ans = 'WA'
if c_idx is None:
    ans = 'WA'
else:
    s[0] = 'a'
    s[c_idx] = 'c'
    if [ i.lower() for i in s ] != s:
        ans = 'WA'
print(ans)
S = list(input())
a_flag = 0
c_flag = 0
c_count = 0
flag2 = 0
if S[0] == 'A':
    a_flag += 1
for i in range(2, len(S)-1):
    if S[i] == 'C' and i == 2:
        c_flag += 1
        c_count += 1
    elif S[i] == 'C':
        c_flag += 1
        c_count += 1
    elif S[i].isupper():
        flag2 += 1

if S[len(S) - 1].isupper() or S[1].isupper():
    flag2 += 1
if a_flag == 1 and c_flag == 1 and flag2 == 0 and c_count == 1:
    print('AC')
else:
    print('WA')
import sys
sys.setrecursionlimit(100000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

def main():
    S = input()
    flag = True
    if S[0] != 'A' or S[2:-1].count('C') != 1:
        flag = False
    for i in range(len(S)):
        if S[i] not in 'ACabcdefghijklmnopqrstuvwxyz':
            flag = False
            break
    print('AC' if flag else 'WA')
if __name__ == '__main__':
    main()
s = input()

flag = True

if s[0] != 'A' or s.count('C') != 1 or s[2:-1].count('C') != 1:
    flag = False
else:
    for i in range(1, len(s)):
        if s[i] != 'C' and s[i].isupper():
            flag = False

print('AC') if flag else print('WA')
s = str(input())
count = 0
ansFlg = 0

if s[0] == "A":
    s = "a" + s[1:]
    ansFlg += 1

for i in range(2, len(s)-1):
    if s[i] == "C":
        s = s[:i] + "c" + s[i + 1:]
        count += 1
if count == 1:
    ansFlg += 1

if s.islower():
    ansFlg += 1

if ansFlg == 3:
    print("AC")
else:
    print("WA")
# abc104_b.py
S = input()
upper_cnt=0
for i,c in enumerate(S):
    if (i==0 and c!="A") or S[2:-1].count("C")!=1 or (i==1 and not c.islower()):
        print('WA')
        exit()
    if i>=1 and c.isupper():
         upper_cnt+=1
    if upper_cnt >1:
        print('WA')
        exit()
print('AC')
S=input()
if S[0]!='A':
  print('WA')
  exit()

if 'C' not in S[2:-1]:
  print('WA')
  exit()

s=list(S)
s.remove('A')
s.remove('C')

for x in s:
  if x not in 'abcdefghijklmnopqrstuvwxyz':
    print('WA')
    exit()

print('AC')
S = input()
if S[0] == 'A' and S.count('C', 2, -1) == 1 and S.replace('A', '').replace('C', '').islower():
    print('AC')
else:
    print('WA')
import re
s = input()
print("AC" if re.match(r'^A[a-z][a-z]*C[a-z]*[a-z]$',s) else "WA")
s = input()
count1 = 0
count2 = 0
count3 = 0
count4 = 0
if s[0] == 'A'and s[1].islower() == True and s[len(s)-1].islower() == True:
    count1 += 1
for i in range(2, len(s) - 1):
    if (s[i] == 'C'):
        count2 += 1
if count1 != 1 or count2 != 1:
    print('WA')
else:
    print('AC')
s=input()
x=0
ans="WA"
if s[0]=="A":
  if s[2:-1].count("C")==1:
    x=s[2:-1].find("C")+2
    t=s[1:x]+s[x+1:]
    if t.islower():
      ans="AC"
print(ans)
s = list(input())

c = 0
f = len(s)
if s.count('C') == 1:
    d = s.index('C')
else:
    d = 0
for i in range(0,len(s)):
    if s[i].isupper() == True:
        c += 1
if s[0] == 'A':
    if d < f-1 and d > 1:
        if c == 2:
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')
s = input()

if s[0] != "A":
  print("WA")
  exit()
if s[2:-1].count("C") != 1:
  print("WA")
  exit()
t = s.index("C")
if s[1:t].islower() == False or s[t+1:].islower() == False:
  print("WA")
  exit()
print("AC")
s_list = list(input())
n = len(s_list)
c_count = 0
if s_list[0] == "A":
    for s in s_list[2:-1]:
        if s == "C":
            c_count += 1
    if c_count == 1:
        if all([(s_list[i] == "C" and 2 <= i <= n - 2) or s_list[i].islower() for i in range(1, n)]):
            print("AC")
            exit()
print("WA")
s=input()
if s.count("A")==1 and s.count("C")==1:
    if "C" in s[2:-1] and s[0]=="A":
        s=s.replace("A","a")
        s=s.replace("C","b")
        t=s.lower()
        if s==t:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")
s = list(input())

bl = False
s1 = s[1]
s2 = s[2:len(s)-1]
s3 = s[-1]

if s[0] == 'A' and s[2:len(s)-1].count('C') == 1:
    s2.remove('C')
    s2 = ''.join(s2)
    ss = s1+s2+s3
    if ss.islower():
        bl = True

print('AC' if bl else 'WA')
S = input()

if S[0] != "A":
    print("WA")
    exit()

if S[1].isupper():
    print("WA")
    exit()

if S[-1].isupper():
    print("WA")
    exit()

ok = False
for i in range(2, len(S) - 1):
    if S[i].isupper():
        if ok:
            print("WA")
            exit()
        else:
            ok = True
if ok is False:
    print("WA")
else:
    print("AC")
s = input()

if s[0] != 'A':
        print('WA')
        exit()

if s[2:-1].count('C') != 1:
        print('WA')
        exit()

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

if s[1:].islower():
        print('AC')
else:
        print('WA')
s = input()
if s[0] != 'A':
	print("WA")
	exit()
else:
	s = s[1:]
if 'C' not in s[1:-1]:
	print("WA")
	exit()
else:
	i = s.index('C')
	s = s[:i] + s[i+1:]
print("AC" if s.islower() else "WA")
ans = "WA"
s = list(input())
if s[0] == "A":
    c_index = [i for i, x in enumerate(s[2:-1]) if x == 'C']
    if len(c_index) == 1:
        s.pop(c_index[0] + 2)
        s.pop(0)
        s = "".join(s)
        if s.islower():
            ans = "AC"
print(ans)
s=input()
flag=True
if s[0]!='A':
  flag=False
if s[1].isupper():
  flag=False
cnt=0
for i in range(2,len(s)-1):
  if s[i]=='C':
    cnt+=1
  elif s[i].isupper():
    flag=False
if s[len(s)-1].isupper():
  flag=False
if cnt!=1:
  flag=False
if flag:
  print("AC")
else:
  print("WA")
import re
ans=re.match("^A[a-z]+C[a-z]+$",input())
print("AC" if ans else "WA")
S = list(input())
N = len(S)

ans = 'AC'
if S[0] != 'A' or 'C' not in S[2:-1]:
    ans = 'WA'

tmp = 0
for i in range(1,N):
    if S[i].isupper():
        tmp += 1

if tmp > 1:
    ans = 'WA'

print(ans)
def main():
    S = input()

    if S[0] != 'A':
        print('WA')
        exit()
    S = 'a'+S[1:]
    if S.count('C', 2, len(S)-1) != 1:
        print('WA')
        exit()
    tmp = S[2:len(S)-1].find('C') + 2
    S = S[:tmp] + 'c' + S[tmp+1:]
    if S != S.lower():
        print('WA')
        exit()
    print('AC')


if __name__ == "__main__":
    main()
# import sys

s = input()

ans = "AC"
cnt = 0

if s[0] != "A":
    ans = "WA"

for i in range(1, len(s)):
    t = s[i]
    if t == "C":
        if 2 <= i < len(s) - 1:
            cnt += 1
    else:
        if t.isupper():
            ans = "WA"

if cnt != 1:
    ans = "WA"

print(ans)
S = list(input())
cnt1 = 0
cnt2 = 0
if S[0] == 'A':
    for i in range(2, len(S)-1):
        if S[i] == 'C':
            cnt1 += 1
    if cnt1 == 1:
        for j in range(len(S)):
            if S[j].isupper():
                cnt2 += 1
        if cnt2 == 2:
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')
text = list(input())
check = 0
flag = False

def upper_count(string,c = 0):      # 文字列中の大文字の個数をカウント
      for i in range(len(string)):
            if string[i].isupper() == True:
                  c += 1
      return c

if text[0] == "A":
      if "C" in text[2:len(text)-1]:
            flag = True

#print(flag,upper_count(text))

if flag == True and upper_count(text) == 2:
      print("AC")
else:
      print("WA")
s = input()

if (s[0] == "A")&(s[2:-1].count("C")==1)&(s.replace("A","").replace("C","") == s.replace("A","").replace("C","").lower()):
    print("AC")
else:
    print("WA")
S = input()

ans = "WA"
if S[0] == "A":
    if S[2:-1].count("C") == 1 and S.count("C") == 1:
        n = len(S)
        for i in range(len(S)):
            if S[i] == "A" or S[i] == "C":
                pass 
            elif S[i].isupper() == True:
                n -= 1
                break
        if n == len(S):
            ans = "AC"

print(ans)
s = input()

if s[0]=='A' and s.count('C',2,-1)==1:
    #print(s[1:2]+s[2:-2].replace('C','')+s[-2:])
    if (s[1:2]+s[2:-1].replace('C','')+s[-1:]).islower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

s = input().strip()

if s[0] != 'A':
    print('WA')
    sys.exit(0)

if s.count('C') != 1:
    print('WA')
    sys.exit(0)

if not (2 <= s.find('C') <= len(s) - 2):
    print('WA')
    sys.exit(0)

if not s.replace('A', '').replace('C', '').islower():
    print('WA')
    sys.exit(0)

print('AC')
s = input()

j1 = s[0] == 'A'
j2 = s[2:-1].count('C') == 1
j3 = True

s3 = set(s) - set('AC')
for i in s3:
    if i != i.lower():
        j3 = False
        break

print('AC') if j1 and j2 and j3 else print('WA')
s=str(input())
f=s[0]=="A" and s[2:-1].count("C")==1
g=(s[1]+s[2:-1].replace("A","a").replace("C","c")+s[-1]).islower()
h=f and g
print("AC" if h is True else "WA")
s=input()
ans="WA"
s_1 = s[1:].replace("C","")
if s[0]=="A" and s[2:-1].count("C")==1 and s_1.islower():
    ans="AC"
print(ans)
s = 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=input()
if s[0]=='A' and s[2:-1].count('C')==1:
    for i in s[1:]:
        if i !='C' and i!=i.lower():
            print('WA')
            exit()
    print('AC')
else:
    print('WA')
s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1:
    for i in range(len(s)):
        if not (i == 0 or i == s[2:-1].index('C')+2):
            if not s[i].islower():
                print('WA')
                exit()
    print('AC')
    exit()
print('WA')
s = input()
flg = 0
if s[0] != "A":
  flg = 1
if s[2:-1].count("C") != 1:
  flg = 1
else:
  l = s.index("C")
  s = s[1:l] + s[l+1:]
  if s.islower():
    pass
  else:
    flg = 1
if flg == 1:
  print("WA")
else:
  print("AC")
s = input()
ans = 'WA'
if s[0]=='A' and s.count('C')==1 and s.index('C') in range(2,len(s)-1) and s[1:].replace('C','c') == s[1:].lower():
    ans = 'AC'   
print(ans)
import sys

s = input()

if s[0] != "A":
    print("WA")
    sys.exit(0)

if s[1] < "a" or s[1] > "z":
    print("WA")
    sys.exit(0)


sub = s[2:-1]
has = False
for c in sub:
    if not has and c == "C":
        has = True

    elif "a" <= c <= "z":
        continue

    else:
        has = False
        break

if not has:
    print("WA")
    sys.exit(0)

if "a" <= s[-1] <= "z":
    print("AC")
else:
    print("WA")
S = input()
flag = 0
if S[0] == 'A' and S[2:-1].count('C')==1 :
    if S.replace('A',"").replace('C',"").islower():
        flag =1
        print('AC')
if flag == 0:
    print('WA')
import re

S = str(input())
if (S[0]=='A')\
   and (S[2:-1].count('C') == 1)\
   and (len(re.findall('[A-Z]', S)) == 2):
    print('AC')
else:
    print('WA')
s=input()
flag=0
if s[0]=="A":
    if s[2:-1].count("C")==1:
            if s[1:].replace("C","c").islower():
                    print("AC")
                    flag=1
if flag==0:
    print("WA")
s = input()
#print(s[3:-2])
if(s[0] =="A"):
  if(s[2:-1].count("C") == 1):
    a = s.index("C")
    s = list(s)
    del s[0]
    del s[a-1]
    s = ''.join(s)
    if(s.islower()):
      print("AC")
    else:
      print("WA")
  else:
    print("WA")
else:
  print("WA")
#print(tmp)
s = input()
ok = True
if s[0] != 'A': ok = False
if s[1].isupper(): ok = False
if s[-1].isupper(): ok = False
c = 0
for si in s[2:-1]:
    if si == 'C': c += 1
print('AC' if ok and c==1 else 'WA')
def l():
    print("WA")
    exit()
s = input()
if s[0] != "A": l()
c = 0
for i in s[2:-1]:
    if i == "C":
        c += 1
if c != 1: l()
print("AC") if s[1].islower() and s[-1].islower() else l()
s = str(input())
C_count = 0
a = 0
b = 0
c = 0
k = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
if s[0] == "A":
  a += 1
for i in s[2:-1]:
  if i == "C":
    C_count += 1
if C_count == 1:
  b += 1

l = s[1:]
l = l.replace("C","")
if l.islower() == True:
  c += 1
if a == 1 and b == 1 and c == 1:
  print("AC")
else:
  print("WA")
S = input()

 
if S[0]=="A" and S[2:-1].count("C")==1 and S[1:].replace("C","c").islower():
    print("AC")
else:
    print("WA")
# -*- coding: utf-8 -*-
import sys


S_list=list(input().strip())
sub_S = S_list[2:-1]

if S_list[0] != "A"  or  sub_S.count("C") != 1:
    print("WA")
    sys.exit()

check_S = S_list[:]
del check_S[ 2 + sub_S.index("C") ]
del check_S[0]

for word in check_S:
    if "a" <= word <= "z":
        continue
    else:
        print("WA")
        sys.exit()

print("AC")
#!/usr/bin/env python
# coding: utf-8

# In[20]:


S = input()


# In[21]:


mylist = [x for x in S]
if mylist[0] != "A":
    print("WA")
elif mylist[2:-1].count("C") != 1:
    print("WA")
else:
    C_idx = mylist[2:-1].index("C") + 2
    mylist.pop(C_idx)
    if str("".join(mylist[1:])).islower():
        print("AC")
    else:
        print("WA")


# In[ ]:
from collections import Counter
S = input()
def lower_s(string):
    big_c = 0
    for c in string[1:]:
        if c == "C":
            if big_c == 1:
                return False
            else:
                big_c = 1
                continue
        if c == c.upper():
            return False
    return True
if (S[0] == "A") and (Counter(S[2:-1])["C"] == 1) and lower_s(S):
    print("AC")
else:
    print("WA")
#!/usr/bin/env python3

def solve(s):
    return s[0] == "A" and s.count("C",2,-1) == 1 and s[1:].replace("C", "").islower()


def main():
    S = input()
    print("AC" if solve(S) else "WA")
    return

if __name__ == '__main__':
    main()
s = list(input())
if s[0] == 'A' and s[2:-1].count('C') == 1 and s.count('C') == 1:
     s.remove('A')
     s.remove('C')
     if str(s).islower() == True:
          print('AC')
     else:
          print('WA')
else:
     print('WA')