peterverebics/CodeNet_Python_118 huggingface dataset:
S = input()
flag = True
if S[0] != 'A':
    flag = False

cnt = 0
for i in range(2, len(S) - 1):
    if S[i].isupper() == True:
        cnt += 1

if cnt >= 3:
    flag = False

if 'C' not in S[2 : len(S) - 1]:
    flag = False

print('AC' if flag == True else 'WA')
S = str(input())
    
result = False
    
if S[0] == 'A':
    
    check = S[2:len(S)-1]
    
    if check.count('C') == 1:
        
        result = check[1:]
        
        result = result.replace('C','')
        
        if result.islower():
            result = True
            
            
            
            
if result:
    print('AC')
else:
    print('WA')
import sys
S = list(input())
C_cnt,low,upp = 0,0,0
if S[0] != "A" or S[-1].isupper() or S[1] == 'C':
  print("WA")
  sys.exit()
for i in range(2,len(S)-1):
  if S[i] == "C":
    C_cnt += 1
  elif S[i].islower():
    low += 1
  elif S[i].isupper():
    upp += 1
if C_cnt == 1 and low == len(S)-3 and upp == 0:
  print("AC")
else :
  print("WA")
def main():
    S = input()

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


if __name__ == "__main__":
    main()
s = input()
if s[0]=="A" and "C" in s[2:-2] and str(s[0]).isupper()== True and  str(s[1]).islower()==True and str(s[-2:]).islower() == True:
    a=s.index('C')
    if (s[2:a]+s[a+1:-2]).islower()== True:
        print('AC')
    else:
        print('AC')
else:
    print('WA')
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    def main():
        s=input()
        if s[0]=='A' and s[2:-1].count('C')==1:
            for i in range(2,len(s)):
                if s[i]!='C' and s[i].isupper():
                    return 'WA'
            if s[1].islower() and s[-1].islower():
                return 'AC'
        else:
            return 'WA'
    print(main())
resolve()
def main():
    S = input()
    flag = True
    cnt = 0
    for i in range(len(S)):
        if not(i == 0 and S[i] == 'A'):
            print("WA")
            return
        elif 2 <= i <= len(S)-1 and S[i] == 'C':
            cnt += 1
        elif S[i].isupper():
            print("WA")
            return
    if cnt == 1:
        print("AC")
    else:
        print("WA")
            
main()
s = input()
if s[0]=="A" and s[2:-1].count("C")==1 and s[-1]!=1:
  print("AC")
else:
  print("WA")
S = input()

if S[0]=="A" and S[2:-1].count("C")==1:
    if S[1:].replace("C","c").islower:
        print("AC")
else:
    print("WA")
S = list(input())

if S[0] == 'A':
  isC = 0
  for i in S[2:len(S)]:
    if i == 'C':
      isC += 1
  else:
    if isC == 1:
      for i in range(len(S)):
        if S[i] == 'A' or S[i] =='C' or S[i].islower():
          pass
        else:
          print('WA')
          break
      else:
        print('AC')
    else:
      print('WA')
else:
  print('WA')
#!/usr/bin/env python3

s = str(input())

flag = 1
if s[0] != "A":
    flag = 0
if s[2] != "C":
    flag = 0


num_C = 0
for i in s[1:]:
    if i == "C":
        num_C += 1
if num_C >= 2:
    flag = 0

if flag == 0:
    print("WA")
else:
    print("AC")
s=input()
print('Yes' if s[0]=='A' and s[2]=='C' and str.islower(s[1]+s[3:]) else 'No')
import sys
S=input()
first=S[0]
cnt=0
moji=[i for i in "abcdefghijklmnopqrstuvwxyz"]

if first=="A":
  for i in range(2,len(S)-1):
    if S[i]=="C":
      cnt+=1
    else:
      if (S[i] in moji)==False:
        print("WA")
        sys.exit()

  if cnt==1:
    print("AC")
  else:
    print("WA")
        
else:
  print("WA")
S=input()
if S[0]=="A" and S[2:-1].count("C")==1:
    for s in S[1:]:
        if s!="C":
            if s.islower():
                print("AC")
                exit()
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[1:-1].replace('C','')+s[-1]
  if s.islower==False:
    ans='WA'
print(ans)
import sys
input = sys.stdin.readline

S = input().rstrip()
trimed_S = S[3:-2].replace('C', '', 1)

ans = 'AC'
if S[0] != 'A':
  ans = 'WA'
elif not trimed_S.islower() or len(S) - len(trimed_S) != 1:
  ans = 'WA'

print(ans)
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')
S = list(input())
if S[0] != 'A':
    print('WA')
    exit()
if len([s for s in S[3:-2] if s == 'C']) != 1:
    print('WA')
    exit()
SL = [s for s in S if s not in ['A', 'C']]
if not all([sl.islower() for sl in SL]) or len(SL) + 2 != len(S):
    print('WA')
    exit()
print('AC')
s=input()
if s[0]=='A':
  if s[2:-1].count('C')==1:
    s=s[2:-1].replace('C','c')
    s=s[0].replace('A','a')
    if s.islower()==True:
      print('AC')
    else:  print('WA')
  else:  print('WA')
else:  print('WA')
s = list(input())
if s[0].isupper() and s[2:-1].count('C') == 1:
    s.pop(0)
    s.pop(s.index('C'))
    cnt = 0
    for si in s:
        if si.islower():
            cnt += 1
    if cnt == len(s):
        print('AC')
    else:
        print('WA')
else:
    print('WA')
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

S = input()

if S[0] == "A" and S[2:-2].count("C") == 1 and S.count("A") == 1 and S.count("C") == 1:
    S = S.replace("A", "")
    S = S.replace("C", "")
    if S == S.lower():
        print('AC')
        quit()
print('WA')
import copy
s=list(input())
if s[0]=='A' and 'C' in s[2:len(s)] :
  t=copy.copy(s)
  s.remove('A')
  s.remove('C')
  result=''.join(s)
  if len(s)==len(t)-2 and result.islower()==True:
    print('AC')
  else:
    print('WA')
    
else:
  print('WA')
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':
            print('WA')
            exit()

if (p == 'AC' and q != 'AC') or (p != 'AC' and q == 'AC'):
    print('AC')
else:
    print('WA')
def main():
    S = input()

    if S[0] == 'A':
        if S[2]=='C' or S[3]=='C':
            S = S[1]+S[4:]
            if S.islower():
                print('AC')
                return
    print('WA')

if __name__ == '__main__':
    main()
s = input()

if s[0] != 'A' or s[2] != 'C':
  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())
ans="WA"
if S[0]=="A":
    if "C" in S[2:-1] and S.count("C")==1:
        x=S.index("C")
        S[0].lower()
        S[x].lower()
        if S==S.lower():
            ans="AC"
print(ans)
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 == "A" or "C" or s.islower() for s in set(s_list)]):
            print("AC")
            exit()
print("WA")
S = input()

if (S[0]=='A') and (S[2:-1].count('C') == 1) \
    and (S not in 'BDEFGHIJKLMNOPQRSTUVWXYZ') and (S.count('C')==1) and (S.count('A')==1):
    print('AC')
else:
    print('WA')
#104B
s = "AtCoder"
c_list = []
c_count = 0
answer = "WA"
for i in range(2,len(s)):
    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 len(c_list)==1 and c_count==1:
    answer="AC"
print(answer)
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.isupper()==False:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")
s = list(input())

if s[0] == "A" and s[2:-1].count("C") == 1 and s.count("A")==1:

    s.remove("A")
    s.remove("C")
    
    if "".join(s).lower() == "".join(s):
        print("AC")

else:
    print("WA")
S=input()
chk = [False, False, False]
if S[0]=="A":
    chk[0]=True

ind = 0
for i in range(2, len(S)):
    if S[i]=="C":
        chk[1]=True
        ind=i

chk[2]=True
for i in range(len(S)):
    if i==ind or i==0:
        continue
    if S[i].isupper():
        chk[2]=False

if chk[0] and chk[1] and chk[2]:
    print("AC")
else:
    print("WA")
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():
    flag2 += 1
if a_flag == 1 and c_flag == 1 and flag2 == 0 and c_count == 1:
    print('AC')
else:
    print('WA')
S = input()

if S[0] != 'A':
    print("WA")
    exit()
if S[2:-1].count('C') != 1:
    print("WA")
    exit()
if S.replace("AC", "").islower == False:
    print("WA")
    exit()
print("AC")
import sys
S = input()
n = len(S)
for i in range(2, n-1):
    if S[i] == 'C':
        print('AC')
        sys.exit()
print('WA')
s = input()
flg = 1
if (s[0] != 'A'):
    flg = 0
cnt = 0
for i in s[2:-2]:
    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")
S = input()
sl = []
ans = 'AC'

for i in S:
    sl.append(i)
if sl[0] != 'A':
    ans = 'WA'
if sl[2:-1].count('C') != 1:
    ans = 'WA'
    
#print(sl)
#print(sl[2:-1])
print(ans)
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')
S = input()

if S[0] != "A":
  print("WA")
  exit()
if S[1] == "C":
  print("WA")
  exit() 
if "C" not in S:
  print("WA")
  exit()
x = S.index("C")
if "C" in S[x+1:]:
  print("WA")
  exit()
if S[1:x]+S[x+1:] != (S[1:x]+S[x+1:]).lower():
  print("WA")
  exit()

print("AC")
S = list(input())
C = S[2:-1]
if S[0] == "A" and "C" in C:
    print("AC")
else:
    print("WA")
S = input()

ans = "AC"

if S[0] == "A":
    pass
else:
    ans = "WA"

if S[2] == "C" and S[-2] == "C":
    ans = "WA"
elif S[2] == "C" or S[-2] == "C":
    pass
else:
    ans = "WA"

print(ans )
import sys
s = list(input())
if s[0] == 'A' and s[2] == 'C':
    del s[2]
    del s[0]
    s = ''.join(s)
    if s.islower():
        print("AC")
        sys.exit()
print("WA")
S = input ()
T = S.replace('A', '')
T = T.replace('C', '')
U = T.lower ()
if S[0]=='A' and S[2:-2].count('C')==1 and T==U:
  print ('AC')
else:
  print ('WA')
import bisect,collections,copy,heapq,itertools,math,operator,string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
def LS(): return list(input().split())
##################################################
S = S()
condition1 = S[0]=='A'
condition2 = S[2:-2].count('C')==1
S = S.replace('A','a',1)
S = S.replace('C','c',1)
condition3 = S.islower()
print('AC' if condition1 and condition2 and condition3 else 'WA')
s = input()

if(s[0] == "A" and s.count("A") == 1):
    if(s[2:len(s)-1].count("C") == 1 and s.count("C") == 1):
        s.strip("C")
        s.strip("A")
        if(s.islower):
            print("AC")
        else:
            print("WA")
    else: 
        print("WA")
else:
    print("WA")
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    S = list(ns())
    if S[0] == 'A' and 'C' in S[2:-2]:
        S.remove('A')
        S.remove('C')
        for s in S:
            if s.isupper():
                print('WA')
        print('AC')
    else:
        print('WA')


if __name__ == '__main__':
    main()
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.isupper()==False:
            print("AC")
    else:
        print("WA")
else:
    print("WA")
import sys
import re
S = input()
array_S = list(S)

if not ( 4 <= len(S) <= 10 ):
    sys.exit()
if len(re.findall('[A-Z]',S)) != 2:
    print('WA')
    sys.exit()

result = 0
if array_S[0] != 'A': result += 1
if array_S[2:-2].count('C') != 1: result += 1 
array_S.pop(0)
array_S.pop(array_S.index('C'))
if not "".join(array_S).islower(): result += 1 

print('WA') if result != 0 else print('AC')
s = input()

t = 'a'
for i in range(1, len(s)):
    t += s[i]
    if s[i] == 'C':
        t += 'c'

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

if S[0] != "A":
  print("WA")
  exit()
if "C" not in S:
  print("WA")
  exit()
x = S.index("C")
if "C" in S[x+1:]:
  print("WA")
  exit()
if S[1:x]+S[x+1:] != (S[1:x]+S[x+1:]).lower():
  print("WA")
  exit()

print("AC")
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"
if S[-1] <"a" or "z" < S[-1]:
    ans = "WA"
  
print(ans)
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':
        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()
if S[0] != 'A':
  print('WA')
elif S[2:-2].count('C') != 1:
  print('WA')
else:
  cindex = S.index('C')
  for i in range(len(S[1:])):
    if i == cindex:
      continue
    if S[i+1].isupper():
      print('WA')
      exit()
  print('AC')
s=input()
if s[0]!="A" or ("C" not in s[2:-1]) and s.count("C")!=1 or s[1:].replace("C","").lower()!=s[1:].replace("C",""):
    print("WA")
else:print("AC")
s=list(input())
s1=s[2:-1]
f=True
if s[0]!='A':
	f=False
elif 'C' not in s1:
	f=False
else:
	s1.remove('C')
	if str(s1).islower():
		pass
	else:
		f=False
if f:
	print('AC')
else:
	print('WA')
s=input()
res="AC"
if s[0]=="A":res="WA"
elif s[2:-2].count("C")!=1:res="WA"
elif "A" in s and "C" in s[2:-2]:
    li=list(s)
    li.remove("A")
    li.remove("C")
    for i in li:
        if i!=i.lower():
            res="WA"
print(res)
s=input()
print("AC" if s[0]=="A" and s[2:-1].count("C")==1 and s.strip("A").strip("C").islower() else "WA")
s = input()
k = False
if s[0] != 'A':
    print('WA')
else:
    if s[2:-1].count('C') == 1:
        s = s[1:s.find('C')] + s[s.find('C')+1:]
        if s.islower():
            print('AC')
    else:
        print('WA')
#!/usr/bin/env python3

s = str(input())

flag = 1
if s[0] != "A":
    flag = 0
if s[2] != "C":
    flag = 0


num_C = 0
for i in s[1:]:
    if i == "C":
        num_C += 1
if num_C >= 2 or num_C == 0:
    flag = 0

if flag == 0:
    print("WA")
else:
    print("AC")
s = input()
ans = "AC"
if s[0] != "A":
  ans = "WA"
if s[-1].upper() == s[-1]:
  ans = "WA"
if s[1].upper() == s[1]:
  ans = "WA"
if s[2:-1].count("C") != 1:
  ans = "WA"
if not s[2:-1].replace("C", "").islower():
  ans = "WA"
  
print(ans)
import sys
s = input()
if s[0] == "A" and s[2:-1].count("C") == 1:
  x = list(s)
  cnt = 0
  for i in range(len(x)):
    if x[i].isupper:
      cnt += 1
  if cnt == 2:
    print("AC")
    sys.exit()
print("WA")
S = input()
cnt = 0
for s in S[2:-1]:
    if s == 'C':
        cnt += 1
    elif s.isupper():
        print('WA')
        break
else:
    if S[0] == 'A' and cnt == 1:
        print('AC')
    else:
        print('WA')
S = input()
if S[0].isupper() and S[2:-1].count("C") == 1 and S[1].islower and S[-1].islower:
    print("AC")
else:
    print("WA")
S = input()
if S[0] != "A":
  print("WA")
  exit()
elif S[2:-2].count("C") != 1:
  print("WA")
  exit()
else:
  if S.count("C") != 0:
    print("WA")
  else:
    S = S[1:].replace("C", "")
    if S.islower():
      print("AC")
    else:
      print("WA")
S = input()
if S[0] != 'A':
  print('WA')
elif S[2:-2].count('C') != 1:
  print('WA')
else:
  cindex = S.index('C')
  for i in range(len(S[1:])):
    if i+1 == cindex:
      continue
    if S[i+1].isupper():
      print('WA')
      exit()
  print('AC')
S = input().rstrip()
cnt = 0
for s in S[2:-1]:
    if s == "C":
        cnt += 1
    else:
        if not s.islower():
            print("WA")
            exit()
if cnt == 1 and S[0] == "A" and S[1].islower():
    print("AC")
else:
    print("WA")
s = list(input())

a = False
c = False
small = False
for i in range(len(s)):
    if i == 0 and s[i] == "A":
        a = True
    if a == True and i >= 2 and i < len(s) - 1 and s[i] == "C" and c == False:
        c = True
    elif s[i] >= "a" and s[i] <= "z":
        small = True
    else:
        small = False
        break

if a == True and c == True and small == True:
    print("AC")
else:
    print("WA")
s=input()
if s[0] == 'A':
  if s[-1] != 'C':
    if s.count('C',1,-2)==1:
      print('AC')
    else:
      print('WA')
  else:
      print('WA')
else:
      print('WA')
def f(s):
  u = 0
  for c in s:
    if c.isupper:
      u += 1
  return u == 1
s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1 and f(s):
  print('AC')
else:
  print('WA')
S = input()

ans = 'AC'

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

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

X = S[1:].split('C')
for x in X:
    if x.islower:
        pass
    else:
        print('WA')
        exit()

print('AC')
import re

S = input()

ans = "WA"

if S[0] != "A":
  ans = "WA"
  print(ans)
else:
  if S[2:len(S) - 1].count("C") != 1:
    print(ans)
  else:
    s = S.index("C")
    SS = S[2:s] + S[s + 1:]
    if SS.islower() == False:
      print(ans)
    else:
      print("AC")
import sys

S = str(input())
flag = 0
if S[0] != "A":
  print("WA")
else:
  S = S[1:]
  S = list(S)
  if S[0] != "C" and S[-1+len(S)] != "C":
    for i in range(1, -1+len(S)):
      if S[i] == "C":
        flag = flag + 1
  else:
    print("WA")
    sys.exit()
if flag != 1:
  print("WA")
  sys.exit()
else:
  S.remove('C')
  flag = 0
  for i in range(len(S)):
    if ord(S[i]) < 97:
      flag = flag + 1
if flag != 0:
  print("WA")
else:
  print("AC")
S = input()
L = [chr(i) for i in range(97, 97+26)]
if S[0] == "A" and S[2] == "C":
  T = "AC"
  for i in range(1,len(S)):
    if i != 2:
      if not S[i] in L:
        T = "WA"
        break
  print(T)
else:
  print("WA")
S = input()
d = [chr(ord('A')+i) for i in range(26)]
first = S[0] == 'A'
second = sum([1 if i == 'C' else 0 for i in S[2:-2] ])
third = sum([1 if i in d else 0 for i in S ])
if first and second and third == 2:
    print('AC')
else:
    print('WA')
s = list(input())
if s[0]=="A" and s[2:-2].count("C")==1:
  s.remove("A")
  s.remove('C')
  if str(s).islower():
    print("AC")
else:
  print('WA')
s = input()
if s[0] == "A" and "C" in s[2:-1] and s[1:].replace("C","").islower():
    print("AC")
else:
    print("WA")
import re
s = input()
cnt = 0
if (s[2:-1].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')
s=list(input())
res = "AC"
if s[0]!="A" or not "C" in s[2:-2]:res="WA"
else:
    s.remove("A")
    s.remove("C")
    s="".join(s)
    if s.lower()!=s :res ="WA"
print(res)
def f(s):
  u = 0
  for c in s:
    if c.isupper:
      u += 1
  return u == 1
s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1 and f(s[1:]):
  print('AC')
else:
  print('WA')
s = input()
if s[0]=="A" and "C" in s[2:-1] and str(s[0]).isupper()== True and  str(s[1]).islower()==True and str(s[-1:]).islower() == True:
    a=s.index('C')
    if (s[2:a]+s[a+1:-1]).islower()== True:
        print('AC')
else:
    print('WA')
s=input()
count=0
for i in range(2,len(s)-1):
    if s[i]=="C":
        count+=1
if s[0]=="A" and count==1 and not s.replace("A","").replace("C","").isupper():
    print("AC")
else:
    print("WA")
s = input()

if(s[0] == "A"):
    if(s[2:len(s)-1].count("C") == 1 and s.count("C") == 1):
        s.strip("C")
        s.strip("A")
        if(s.islower):
            print("AC")
        else:
            print("WA")
    else: 
        print("WA")
else:
    print("WA")
# 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 = sub.replace("C", "")
    if sub2 != sub2.lower():
        return False
    return True

ans = "AC"

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

print(ans)
s = str(input())

flag = 0

if s[0] == 'A':
    s = s[0].lower() + s[1:]
    print(s)

    for i  in range(2, len(s)-1):
        if s[i]  == 'C':
            flag += 1
            s = s[:(i-1)] + s[i].lower() + s[i+1:]
            print(s)
            break
    
    if s.islower():
        flag += 1


if flag == 2:
    print('AC')
else:
    print('WC')
s = input()
cnt = 0
if s[0] == 'A' and s[1].islower() and s[-1].islower():
    for i in range(len(s)-4):
        if s[i+2] == 'C':
            cnt += 1
        elif s[i+2].islower():
            continue
        else:
            cnt = None
            break
if cnt == 1:
    print('AC')
else:
    print('WA')
s = input()
ans = "WA"

if s[0] == "A" and s[2:-1].count("C") == 1:
	for i in s[1:]:
		if i.islower() or i =="C":
			ans = "AC"
			
print(ans)
S = input()

if (S[0] == "A")and (S[2:len(S)-1].count("C") ==1):
  
  print("AC")
else:
  print("WA")
S=input()
N=len(S)
count=0
if S[0]=="A":
	if S[2:-2].count("C")==1 and S[1]!="C"and S[-1]!="C":
		P=S.replace("A","")
		Q=P.replace("C","")
		if Q.islower():
			print("AC")
		else:
			print("WA")
	else:
		print("WA")
else:
	print("WA")
import re;print("AC" if re.fullmatch("A[b-z]+C[b-z]+", input()) is not None else "WA")
S = input()

ans = "AC"

if S[0] != 'A' or S.count("C", 2, -1) != 1:
  ans = "WA"
for i in range(1, len(S) - 1):
  if S[i].isupper == True and S[i] != 'C':
    ans = "WA"
print(ans)
s=input()
if s[0]=="A":
    count=0
    for i in range(2,len(s)-1):
        if s[i]=="C":
            count+=1
        else:
            if s[i]==s[i].upper():
                print("WA")
                exit()
    if count==1:
        print("AC")
    else:
        print("WA")
else:
    print("WA")
import sys
input = sys.stdin.readline
S = list(input().strip())
flag = False
if S[0] == "A" and "C" in S[2:-1]:
    count = 0
    for s in S:
        if s < "D":
            count += 1
    if count == 2:
        flag = True
if flag:
    print("AC")
else:
    print("WA")
s = input()

if s[0] == "A":
	if s[2:-1].count("C") == 1:
		for i in s[1:]:
			if i.islower() or i =="C":
				print("AC")
				exit()
print("WA")
s = input()
ans = 'WA'
if s[0] == 'A' and (s[3] == 'C' or s[-2] == 'C') and s[3]+s[-2] != 'CC' and s.islower():
  ans = 'AC'
print(ans)
s = input()
length = len(s)
cnt = 0

if s[0] != 'A':
    print('WA')
    exit()
if s[length-1].isupper():
    print('WA')
    exit()

for i in range(2, length-1):
    if s[i].isupper():
        if s[i] != 'C':
            print('WA')
            exit()
        else:
            cnt += 1

if cnt != 1:
    print('WA')
    exit()

print('AC')
exit()
s=input()
l=len(s)

ans='AC'
c=0
cp=0
if s[0]!='A':
  ans='WA'
for i in range(2, l-1):
  if s[i]=='C':
    c+=1
    cp=i
if c!=1:
  ans='WA'
ls = s[1:cp] + s[cp+1:l]
if not ls.islower:
  ans='WA'
print(ans)
S = str(input())
short_alp = "ABDEFGHIJKLMNOPQRSPUVWXYZ"
if S[0] == 'A' and S.count('C') == 1 and S[2:-2].count('C') == 1:
  for i in range(1,len(S)-1):
    if S[i] in short_alp:
      print("WA")
      exit()
  print("AC")
else:
  print("WA")
import sys
input=sys.stdin.readline
S=list(input())
print("AC" if S[0]=="A" and S[-1]!="C" and S.count("C") == 1 and S[1] != "C" else "WA" )