peterverebics/CodeNet_Python_118 huggingface dataset:
alf = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
s = input()
if s[0] != 'A':
  print('WA')
  exit()
cnt = 0
pos = 0
for i,c in enumerate(s[2:-2]):
  if c == 'C':
    cnt += 1
    pos = i+2
if cnt != 1:
  print('WA')
  exit()
for i,c in enumerate(s[1:]):
  if i+1 != pos and c in alf:
    print('WA')
    break
else:
  print('AC')
s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1 and s[-1].islower():
    ind = s.index('C')
    if s[1:ind].islower and (ind == len(s) - 2 or s[ind+1:-1].islower()):
        print('AC')
        exit()
print('WA')
s = list(input())
if s.pop(0)=="A" and s[1:-2].count("C")==1:
    s.pop(s.index("C"))
    if "".join(s).islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")
S = input()
count = 0
if S[0] == 'A':
    S = S[1:]
    for i in range(1, len(S)-1):
        if S[i] == 'C' and (S[0:i] + S[i+1:]).islower():
            print('AC')
            break
else:
    print('WA')
S = input()
if S[0] == "A":
    if (S.count("C") == 1) and ("C" in S[2:-2]):
        S = S[1:].replace("C", "")
        if S.islower():
            print("AC")
            exit(0)

print("WA")
s = input()
print('AC' if s[0] == 'A' and 'C' in s[3:-2] and s.replace('A', '').replace('C', '').islower() else 'WA')
s=input()
if s[0] == 'A':
  if s[-1] != 'C':
    if s.count('C',2,-2)==1:
      print('AC')
    else:
      print('WA')
  else:
      print('WA')
else:
      print('WA')
s = list(input())
flg = True

if s[0] != "A":
    flg = False

count = 0
for i in s[2:-1]:
    if i == "C":
        count += 1

if count != 1:
    flg = False

if flg:
    print("AC")
else:
    print("WA")
s = input()
ans = 'WA'
a = []
if s[0] == 'A' and s[2:-1].count('C') == 1:
     a = list(s)
     a.remove('A')
     a.remove('C')
     a = str(a)
     if a.islower() == 0:
          ans = 'AC'
print(ans)
S = input()

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

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

for i in range(2,len(S)):
    if i != S.index('C'):
        if not S[i].islower():
            print('WA')
            exit()

print('AC')
a = input()

flag = True

for i in range(len(a)):
    if i == 0 and a[i] != 'A':
        flag = False
        break
    elif i == 2 and a[i] != "C":
        flag = False
        break
    elif i != 0 and i != 2 and not a[i].islower():
        flag = False
        break

if flag:
    print("AC")
else:
    print("WA")
S = list(input())
count = 0
if S[0] == 'A':
    for i in range(2,len(S)-1):
        if S[i] == 'C':
            count += 1
    if count == 1:
        print('AC')
    else:
        print('WA')
else:
    print('WA')
s = list(input())
if s[0] != "A" or s[2:-2].count("C") >= 2 or s[2:-2].count("C") == 0:
  print("WA")
  exit()
else:
  s[0] = "a"
  for i in range(2,len(s)-2):
    if s[i] == "C":
      s[i] = "c"
  for i in s:
    if i != i.lower():
      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:]
    if len([i for i in sub if i == "C"]) != 1:
        return False

    sub2 = sub.replace("C", "")
    if sub2 != sub2.lower():
        return False
    return True

ans = "AC"

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

print(ans)
S=input()
print('WAAC'[S[0]=='A' and S.count('C',2,-2)==1 and len(list(filter(lambda x: x.isupper(),list(S))))==2::2])
S = input()
if S[0] != "A":
    print("WA")
    exit()
if S[2:-2].count("C") != 1:
    print("WA")
    exit()
if (S[1:S.index("C")] + S[S.index("C")+1:]).islower():
    print("AC")
else:
    print("WA")
s = str(input())
S = [s[i] for i in range(len(s))]
fr = 0
count = 0
if S[0] == 'A':
    S.pop(0)
else:
    fr = 1
for i in range(1,(len(S)-2)):
    if S[i] == 'C' and count == 0:
        S.pop(i)
        count += 1
s = ''.join(S)
if s.islower() and count == 1 and fr == 0:
    print('AC')
else:
    print('WA')
s = input()

if s[0] != 'A' or s[2:-1].count('C') != 1:
  print('WA')
else:
  for i,c in enumerate(s):
    if i in (0,2):
      continue
    else:
      if not 'a'<=c<='z':
        print('WA')
        break
  else:
    print('AC')
s = str(input())
count = 0
ansFlg = 0

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

for i in range(2, len(s)-3):
    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")
S = input()
N = len(S)

cond1 = True if S[0] == 'A' else False
cond2 = True if S[3:-2].count('C') == 1 else False
cond3 = True if sum(map(lambda x: x.islower(), S)) == N-2 else False

print('AC') if cond1 and cond2 and cond3 else print('WA')
S = input()
if S[0] != 'A':
    print('WA')
    exit()
if S[2:-1].count('C') != 1:
    print('WA')
    exit()
for i in range(len(S)):
    if i in [0, 2]:
        if S[i] != S[i].upper():
            print('WA')
            exit()
        continue
    if S[i] != S[i].lower():
        print('WA')
        exit()
print('AC')
import  re
s = input()
print(s[0] == "A" and s[2:-2:].count("C") ==1 and len(re.findall("[a-z]",s)) == len(s)-2 \
        and "AC" or "WA")
if __name__ == '__main__':

	s = input()
	ans = 0

	if s[0] == "A":
		ans += 1

	tmp = s[2:-1]
	if tmp.count("C") == 1:
		ans += 2

	tmp2 = s[1:-1]
	if s.count("C") == 1:
		tmp2 = tmp2.replace("C","c")
		if tmp2.lower() == tmp2:
			ans += 4

	if ans == 7:print("AC")
	else:		print("WA")
S = input()
N = len(S)
 
cond1 = True if S[0] == 'A' else False
cond2 = True if S[3:-2].count('C') == 1 else False
cond3 = True if sum(map(lambda x: x.islower(), S)) == N-2 else False
 
print('AC') if cond1 and cond2 and cond3 else print('WA')
s = input()
ans = 'WA'

if s[0] == 'A' and s.count('C') == 1 and 'C' in s[2:-2]:
    s = s.lstrip('A')
    s = s.replace('C','')
    if not s.isupper():
        ans = 'AC'

print(ans)
S = input()

def word_check(S):
    if S[0] == "A":
        if S[1] not in ["A", "C"] and S[-1] not in ["A", "C"]:
            count_C = 0
            for s in S[2: -1]:
                if s == "C":
                    count_C += 1
            if count_C == 1:
                return "AC"
    return "WA"

print(word_check(S))
import sys
input = sys.stdin.readline

S = list(input().rstrip('\n'))
# print(S[2:-1])
if S[0] == 'A' and S[2:-1].count('C') == 1:
    S.remove('A')
    S.remove('C')
    S = ''.join(S)
    # print(S)
    if S.islower:
        print("AC")
    else:
        print("WA")
else:
    print("WA")
s = input()
if s[0] != 'A':
    print('WA') 
else:
    ii = s.count('C',2,-2)
    if ii != 1:
        print('WA')
    else:
        s_1 = s.lstrip('A')
        s_2 = s_1[1:-2].replace('C','')
        s_1 = s_1[0] + s_1[-1]
        s = s_1 + s_2
        if s.islower() == True:
            print('AC')
        else:
            print('WA')
s = input()

if(s[0] == "A"):
    if(s[2:len(s)-1].count("C") == 1):
            a = s.strip("C")
            a = s.strip("A")
            if(a.islower):
                print("AC")
            else:
                print("WA")
    else: 
        print("WA")
else:
    print("WA")
s=input()
n=len(s)
x=s[2:n-2]
if s[0]!='A':
    print('WA')
elif x.count('C')!=1:
    print('WA')
else:
    i=s.find('C')
    s=list(s)
    s.pop(i)
    s.pop(0)
    s=''.join(s)
    if s.islower()==True:
        print('AC')
    else:
        print('WA')
s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1 and s.count('C') == 1:
     list(s).remove("A")
     list(s).remove("C")
     if s.islower() == 0:
          print("AC")
          exit()
else:
     print("WA")
S = input()
if S[0] != "A":
  print("WA")
  exit()
elif S[2:-2].count("C") != 1 or S[:2].count("C") != 0 or S[-2:].count("C") != 0:
  print("WA")
  exit()
else:
  S = S[1:].replace("C", "")
  if S.islower():
    print("AC")
  else:
    print("WA")
import sys

s = input()

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

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

if has:
    print("AC")
else:
    print("WA")
S=input()
s=""
flag=1
Cflag=1
if not(S[0]=="A"):
    flag=0
else:
    S=S[2:len(S)-1]
    #print(S)
    for i in range(len(S)):
        if not(S[i]=="C"):
            s="".join((s,S[i]))
        else:
            Cflag=Cflag-1
    if not(Cflag==0):
        flag=0
    if s.islower()==False:
        flag=0

if flag==0:
    print("WA")
else:
    print("AC")
s = input()
ans = 'No'
if s[0] == 'A' and 'C' in s[2:len(s)-1]:
  s = s.replace('A', '').replace('C', '')
  if all([i in [chr(i) for i in range(97, 97+26)] for i in s]):
    ans = "Yes"
print(ans)
s = input()
ans = 'WA'
if s[0] == 'A' and 'C' in s[2:len(s)-1]:
  s = s.replace('A', '').replace('C', '')
  if all([i in [chr(i) for i in range(97, 97+26)] for i in s]):
    ans = 'AC'
print(ans)
S = input()
if S[0] == 'A' and S[2:-1].count('C') == 1:
    S2 = S[1] + S[2:-1].replace('C', '')
    if S2 == S.lower():
        print('AC')
        exit()
print('WA')
S = list(input())

if S[0] == 'A':
    cnt = 0
    for i in range(2, len(S)-1):
        if S[i] == 'C':
            cnt += 1
    if cnt == 1:
        S.sort()
        for i in range(2, len(S)):
            if str(i).isupper():
                print('WA')
                exit()
        print('AC')
    else:
        print('WA')
else:
    print('WA')
s=input()
ans='AC'
if s[0]!='A':
  ans='WA'
elif s[2:-1].count('C')!=1:
  ans='WA'
s=sorted(s)
s=s[2:]
for i in s:
  if i.lower()==False:
    ans='WA'
    break
print(ans)
s=input()
cnt=0
if s[0] != 'A':
    print('WA')
if s[2:len(s)-1].count('C') != 1:
    print('WA')
else:
    for i in range(len(s)):
        if s[i].isupper ==True:
            cnt+=1
    if cnt > 2:
        print('WA')
    else:
        print('AC')
s = input()

if s[0] == "A" and s[2:-1].count('C') == 1 and s.translate({'A':'','C':''}).islower:
  print("AC")
else:
  print("WA")
S = input()
N = len(S)
ans = "AC"
if S[0] != 'A':
  ans = "WA"
c = 0
for i in range(2,N-1):
  if S[i] == "C":
    c += 1
  elif S[i] <"a" or "z" < S[i]:
    ans = "WA"
if c != 1:
  ans = "WA"
  
print(ans)
S = input()

if (S[0] == "A")and (S[2:len(S)].count("C") ==1):
  print("AC")
else:
  print("WA")
s=input()
ans='AC'
if s[0]!='A':
  ans='WA'
elif s[2:-1].count('C')!=1:
  ans='WA'
if ans=='AC':
  s=s[1:]
  s=s.replace('C','')
  if s.islower==False:
    ans='WA'
print(ans)
s = input()
count = 0

for i in range(len(s) - 1):
    if s[i].isupper():
        count += 1
#print(count)

if s[0] == 'A':
    for i in range(2 , len(s)-2):
        if s[i] == "C" and count == 2:
            print("AC")
            break
        else:
            print("WA")
            break
else:
    print("WA")
s = input()
if s[0]!='A' or s[2:-1].count('C')!= 1:
  print('WA')
  exit()
  
for c in s[1:]:
  if not('a'<= c <= 'z') or c=='C':
    print('WA')
    break
else:
  print('AC')
S = str(input())
cnt = 0

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

if cnt == 1:
  print("AC")
else:
  print("WA")
s = input()

flag = True

if s[0] != 'A' or s.count('C') != 1 or s[2:-2].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=(input())
k=s[2:-1]
m=k.replace('C', 'c')
if k.count('C')==1 and s[0]=='A' and m==k.lower() and m.count('c')==1:
    print('AC')
else:
    print('WA')
import sys
s = str(input())

ch = s[0]

test_st = s[1:-1]
#print(test_st)
count = 0
if ch == 'A':
    for i in range(len(test_st)):
        if test_st[i] == 'C':
            count += 1
            if count == 1:
                test_stx = test_st[:i]+test_st[i+1:]
    if count == 1 and test_stx.islower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')
s=input()
n=len(s)
ans=1
if s[0]!="A":
  ans *= 0
check=0
for i in range(n):
  if s[i]=="C" and check==0:
    check=1
  elif s[i]=="C":
    check=0
print(["WA","AC"][ans*check])
# abc104_b.py
S = input()
upper_cnt=0
print(S[2:-1])
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=str(input())
temp=list(s)
if temp[0]=="A":
  del temp[len(s)-1]
  del temp[1]
  del temp[0]
  if "C" in temp:
    s=s.replace("A","")
    s=s.replace("C","")
    if s.islower()==True:
      print("AC")
    else:
      print("WA")
  else:
    print("WA")
else:
  print("WA")
S = input()
flag = True

if S[0] != "A":
  flag = False
elif S[2:-2].count("C") != 1:
  flag = False
else:
  tmp = ""
  for s in S:
    if s != "A" and s != "C":
      tmp += s
  if not tmp.islower() or len(tmp) != len(S) - 2:
    flag = False
print("AC" if flag else "WA")
s = input()
n = len(s)
res = []
if s[0] == 'A':
  if s.find('C') >= 2 and s.find('C') < n-2:
    for i in s:
      if i == 'A' or i == 'C':
        res.append(i)
    if res == ['A', 'C']:
      print('AC')
    else:
      print('WA')
  else:
    print('WA')
else:
  print('WA')
S = list(input().strip())
f = True
if S[0] == "A":
    S[0] = "a"
if S[2:-1].count("C") == 1:
    S[S.index("C")] = "c"
else:
    S[0] = "X"
if "".join(S) == "".join(S).lower():
    print("AC")
else:
    print("WA")
S = input()
count = 0
if S[0] == 'A':
    S = S[1:]
    for i in range(1, len(S)-1):
        if S[i] == 'C':
            S = S[0:i] + S[i+1:]
            if S.islower():
                print('AC')
                break
            else:
                print('WA')
                break
        else:
            print('WA')
            break
else:
    print('WA')
s = input()
ac = True
c = True
if s[0] != "A":
  ac = False
if not ord("a") <= ord(s[1]) <= ord("z"):
  ac = False
if not ord("a") <= ord(s[-1]) <= ord("z"):
  ac = False
for i in range(2, len(s)-1):
  if s[i] == "C":
    if c:
      c = False
    else:
      ac = False
  else:
    if not ord("a") <= ord(s[i]) <= ord("z"):
      ac = False
if c:
  ac == False
if ac:
  print("AC")
else:
  print("WA")
s = input()
if s[0]=="A" and s[2:-2].count("C")==1:
    l = []
    for si in s[2:-2]:
        if si=="C":
            pass
        else:
            l.append(si.islower())
    if all(l):
        print("AC")
    else:
        print("WA")
else:
    print("WA")
S = input()

ans = "WA"

if S[0] == "A":
    if (S[2] == "C" and S[-2] != "C") or (S[2] != "C" and S[-2] == "C"):
        removed_str = S[1:2]
        if S[2] == "C":
            removed_str += S[3:]
        else:
            removed_str += S[2:-2] + S[-1]
        if removed_str.islower():
            ans = "AC"

print(ans)
import sys

input = sys.stdin.readline
MOD = 1000000007

S = input()[:-1]
if S[0] !='A':
    print("WA")
    exit()

if 'C' not in S[2:-2] or (S.count('C') > 1) :
    print("WA")
    exit()


if ('c'  in S) or ('a' in S)  :
    print("WA")
    exit()

print("AC")
s=input()
if s.count("A")==1 and s.count("C")==1:
    if "C" in s[2:len(s)-1] and s[0]=="A":
        s=s.replace("A","")
        s=s.replace("C","")
        if s.lower()==True:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")
s = input()
S = s[2:-1].replace("C","c")
if s[0]=="A" and s[2:-1].count("C")==1 and s[-1]!="C" and S.islower():
  print("AC")
else:
  print("WA")
S = input()
rs = 'WA'
if S[0] == 'A' and S[2:-1].count('C')==1:
    S = S[1:2]+S[2:-2].replace('C', '')+S[-2:]
    if S.islower():
        rs = 'AC'
print(rs)
s = input()

if s[0] == 'A' and 'C' in s[2:-1]:
    s = s.replace('A', '')
    s = s.replace('C', '')
    if s.islower():
        print('AC')
        exit()
print('WA')
s = input()
l = len(s)

if s[0] == "A":
    if s[2:l - 1].count("C") == 1:
        s.replace("A", "a")
        s.replace("C", "c")
        if s.islower == True:
            print("AC")
            exit()
print("WA")
import re
s = input()
cnt = 0
if (s[2:-2].count('C') != 1):
    print('WA')
    exit(0)
for i in range(len(s)):
    if (s[i] >= 'A' and s[i] <= 'Z'):
        cnt += 1
        if (cnt >= 3):
            print('WA')
            exit(0)
print('AC')
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()

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

if c_count==1:
    flag=True

if flag:
    print("AC")
else:
    print("WA")
S = input()

# S = 'AaCa'

b = True
b = b and (S[0]=='A')
b = b and ( S[2:-1].count('C')==1 )

b = b and ( 'a' <= S[1] <= 'z')
b = b and ( 'a' <= S[-1] <= 'z')

for c in S[3:-2]:
  b = b and ( 'a' <= c <= 'z' )

print( "AC" if b else "WA" )
s = list(input())
c = 0
if s[0] != 'A':
    print('WA')
else:
    s[0] = 'a'
    for i in range(2,len(s)-2):
        if s[i] == 'C':
            s[i] = 'c'
            c += 1
    news = ''.join(s)
    if news.islower() and c == 1:
        print('AC')
    else:
        print('WA')
s=input()
yn=0
num=0
for i in range(len(s)):
    if i==0:
        if s[0]!="A":
            yn=1
            break
    elif i==2:
        if s[2]!="C":
            yn=1
            break
    else:
        num=ord(s[i])
        if num<93:
            yn=1
            break
if yn==1:
    print("WA")
else:
    print("AC")
s = input()
ans = 1

if s[0] == "A":
    ans += 1
    
part = s[2:-1]
if part.count("C") == 1:
    ans += 1
      
for i in range(len(s)):
    if ord(s[i]) != 65 and ord(s[i]) != 65 and ord(s[i]) < 67:
        ans -= 1
        
print("AWCA"[ans<3::2])
s=input()
def AcCepted(str1):
    if str1[0]!='A':
        return False
    str2=str1[2:-1]
    if str2.count('C')!=1:
         return False
    else:
        str3=str2.strip('C')
        if str3.islower ==False:
            return False
    return True

if AcCepted(s)==True:
    print('AC')
else:
    print('WA')
s=input()
a=True
if s[0]!='A':
    a=False
s2=s[2:-1]
if s2.count('C')!=1:
    a=False
s3=s2.strip('C')
if s3.islower()==False:
    a=False
if a==True:
    print('AC')
else:
    print('WA')
s = list(input())

if "C" in s[2:-2] and s[0]=="A":
    del s[s.index("C")]
    del s[0]
else:
    print("WA")
    exit()

for i in range(len(s)):
    if s[i].islower()==True:
        continue
    else:
        print("WA")
        exit()
print("AC")
#104B
s = "AtCoder"
c_list = []
c_count = 0
answer = "WA"
for i in range(2,len(s)-1):
    if s[i] == "C":
        c_list.append(i)
    if s[i].islower() == False:
        c_count += 1
if s[0]=="A" and s[1].islower()==True and s[-1].islower()==True and len(c_list)==1 and c_count==1:
    answer="AC"
print(answer)
s=input()
print('Yes' if s[0]=='A' and 'C' in s and 1<s.index('C') and s.index('C')+1<len(s) and sum([c.isupper() for c in s])==2 else 'No')
s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1:
    Ci = s.index('C')
    if (s[1:Ci] + s[Ci + 1:]).islower:
        print('AC')
else:
    print('WA')
def check(s):
    if s[0].isupper() and s.count('C') == 1  and  2<= s.index('C') < len(s) -1:
        temp = s[1: s.index('C')] + s[s.index('C')+1: ]
        if temp.islower():
            return 'AC'
    return 'WA'


s= input()
print( check(s))
import sys

def resolve():
    S = input()
    if S[0] == "A" and S[2:len(S)].count("C") == 1:
         if S[1:].replace("C", "").islower():
             print("AC")
             return
    print("WA")

if '__main__' == __name__:
    resolve()
S = input()

ans = "WA"

if S[0] == "A":
    if S[:3].count("C") + S[-2:].count("C") == 1:
        removed_str = ""
        if S[:3].count("C") == 1:
            removed_str += S[1:3].replace("C", "") + S[3:]
        else:
            removed_str += S[1:-2] + S[-2:].replace("C", "")
        if removed_str.islower():
            ans = "AC"

print(ans)
S = list(input())

p = S[0]+S[2]
q = S[0]+S[-2]

flag = 0
for i in range(1,len(S)):
    if i != 2 and i != len(S)-2:
        if not S[i].islower():
            print('WA')
            exit()
    else:
        if S[i] != 'C' and S[i].isupper():
            print('WA')
            exit()
if (p == 'AC' and q != 'AC') or (p != 'AC' and q == 'AC'):
    print('AC')
else:
    print('WA')
s = list(input())

ans = 'AC'
if s[0] != 'A':
    ans = 'WA'
else:  
    s[0] = 'a'

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

wk = ['x' if i == 'C' else i for i in s]
if "".join(wk).isupper():
    ans = 'WA'

print(ans)
s = list(input())
if s[0] == 'A':
  if s[2:-1].count('C') == 1:
    for i in range(1, len(s)):
      if 97 <= ord(s[i]) <= 122:
        print("AC")
      else:
        break
  else:
    print("WA")
else:
  print("WA")
S=input()
k=0
if S[0]=='A':
    for i in range(2,-2):
        if S[i]=='C':
            k=i
            break
            if 'a'<=(S[1:k] and S[k:])<='z':
                print('AC')
                exit()
print('WA')
s = input()
if s[0] != 'A': print('WA')
else:
    c_cnt = 0
    end_p = len(s)-2
    for i in range(1,len(s)):
        
        # C判定
        if 2 <= i < end_p and s[i] == 'C':
            c_cnt += 1
        
        # 小文字かどうか
        elif s[i] != s[i].lower():
            print('WA')
            exit()

    if c_cnt != 1:
        print('WA')
    else:
        print('AC')
#abc104 b
s=input()
x=s[2:-1]
flag=True
if s[0]!="A":
    flag=False
cnt=0
for i in range(len(s)):
    if 2<=i<=(len(s)-2):
        if s[i]=="C":
            cnt+=1
        else:
            if s[i].islower()==False:
                flag=False
if cnt!=1:
    flag=False
if flag:
    print("AC")
else:
    print("WA")
S = input()

ans = "AC"

if S[0] != 'A' or S[2:-1].count('C') != 1:
  ans = "WA"
for i in range(1, len(S)):
  if S[i].isupper == True and S[i] != 'C':
    ans = "WA"
print(ans)
S = input()
if S[0] == 'A' and (S[2:-1]).count('C') == 1:
    S_ = S.replace('A', '').replace('C', '')
    if S_.islower():
        print('AC')
else:
    print('WA')
s = input()
if s[0] == 'A' and 'C' in s[2:-1]:
     a = list(s)
     a.remove('A')
     a.remove('C')
     a = str(a)
     if a.islower() == 0:
          print('AC')
     else:
          print('WA')
else:
     print('WA')
s = input()

if s[0] == "A" and s[2:-1].count("C") == 1:
	num = s.index("C")
	tmp = s.replace("A","").replace("C","")
	if tmp.islower():
		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:-2].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()
count=0
if S[0]=="A":
  for i in range(2,len(S)-2,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()

if s[0]!="A":
  ans="WA"
else:
  c_cnt=s.count("C",2,len(s)-1)
  cnt=s.count("C")
  if c_cnt!=1 or c_cnt!=cnt:
    ans="WA"
  else:
    s=s.replace("C","c")
    if s.isalnum():
      ans="AC"
    else:
      ans="WA"
    
print(ans)
import re
print("WA" if re.match('A[a-z][a-z]*C[a-z]*[a-z]',input()) == None else "AC")
S = input()
ans = 'WA'
if S[0] == 'A':
    if S[2 : -1].count('C') == 1:
        for s in S:
            if s != 'A' and s != 'C' and s == s.lower():
                ans = 'AC'
print(ans)
S = list(input())

p = S[0]+S[2]
q = S[0]+S[-2]

flag = 0
for i in range(1,len(S)):
    if i != 2 and i != len(S)-2:
        if not S[i].islower():
            print('WA')
            exit()

if (p == 'AC' and q != 'AC') or (p != 'AC' and q == 'AC'):
    print('AC')
else:
    print('WA')
S = list(input())
flag = 0
flag2 = 0
if S[0] == 'A':
    flag += 1
    for i in range(2, len(S)-1):
        if S[i] == 'C' and i == 2:
            flag += 1
        elif S[i].isupper():
            flag2 += 1

if S[len(S) - 1].isupper():
    flag2 += 1
if flag == 2 and flag2 == 0:
    print('AC')
else:
    print('WA')
s = input()
l = []
for i in s:
  l.append(i)
if l[0] != "A":
  print("WA")
else:
  l.remove("A")
  if "C" not in l[1:len(l)-2]:
    print("WA")
  else:
    l.remove("C")
    s = "".join(l)
    if s.islower():
      print("AC")
    else:
      print("WA")
S = input()

if S[0] == "A":
    if S.count("C") == 1:
        if S[2:-1].count("C") == 1:
            S = S.replace("A", "")
            S = S.replace("C", "")
            if S.islower():
                exit()

print("WA")