peterverebics/CodeNet_Python_118 huggingface dataset:
s = input()
ans = True

if s[0] != 'A':
    ans = False
# print(s.count('C'))
index = -1
if s[2:-2].count('C') == 1:
    index = s.index('C')
    # print(index)
else:
    ans = False

    
for i in range(len(s)):
    if i == 0:
        continue
    if i == index:
        continue
    if not s[i].isupper():
        ans = False


if ans:
    print('AC')
else:
    print('WA')
s=input()
n=len(s)
f=True
if s[0]!='A':
    f=False
if s[2:n-1].count('C')!=1:
    f=False
for ss in s:
    if ss!='A' and s!='C' and s.isupper():
        f=False
print('AC' if f else 'WA')
s=input()
yn=0
if s.count("C")==1 and s[0]=="A" and s[1]!="C" and s[len(s)-1]!="C":
    for i in range(2,len(s)-1):
        if ord(s[i])<96:
            if s[i]!="C":
                yn=1
    if yn==1:
        print("WA")
    else:
        print("AC")
else:
    print("WA")
S=input()
if S[0]=="A" and S[1:-1].count("C")==1:
    for s in S[1:]:
        if s!="C":
            if s.islower():
                print("AC")
                exit()
print("WA")
s = input()
n = len(s)
 
res = "AC"
 
if s[0] != "A":
  res = "WA"
c = 0
for i in range(2,n-1):
  if s[i].isupper():
    if s[i] != "C":
      res = "WA"
    else:
      c += 1
if c != 1:
  res = "WA"
print(res)
s=input()
print('AC' if s[0]=='A' and s[2]=='C' and str.islower(s[1]+s[3:]) else 'WA')
def AcCepted(s):

    ans = "WA"

    if s[0] == "A" and s[1:-2].count("C") == 1:
        s = s.replace("C" , "c")
        if s[1:].islower():
            ans = "AC"

    return ans

def main():
    s = str(input())
    print(AcCepted(s))

if __name__ == '__main__':
    main()
s = input()
print('AC' if s[0] == 'A' and 'C' in s[2:-1] and s[1:].replace('C', '').islower() else 'WA')
S=input()
ans = "WA"
if S[0] == "A" and ("a" <= S[1] <= "z") and ("a" <= S[-1] <= "z"):
  s0 = S[2:-1]
  f = 0
  for i in range(len(s0)):
    if s0[i] == "C":
      if f != 0:
        ans = "NG"
      else:
        ans = "AC"
        f = 1

print(ans)
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    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():
                print('WA')
        if s[1].islower() and s[-1].islower():
            print('AC')
    else:
        print('WA')
resolve()
S = list(input())
A_check = []
C_check = []
lower_check = []

for i in range(len(S)):
    if S[i] == 'A':
        A_check.append(i)
    
    if S[i] == 'C':
        C_check.append(i)
    
    if S[i].islower():
        lower_check.append(i)
        

if len(A_check) != 1 or len(C_check) != 1 or len(lower_check) != (len(S) - 2):
    print('WA')
elif A_check[0] != '0' or C_check[0] == len(S) - 1 or C_check[0] < 2:
    print('WA')
else:
    print('AC')
s=input()
yn=0
if s[0]=="A" and ord(s[2])>95 and ord(s[len(s)-1])>95 and s.count("C")==1:
    for i in range(len(s)-3):
        if s[i+2]!="C" and ord(s[i+2])<92:
            yn=1
    if yn==1:
        print("WA")
    else:
        print("AC")
else:
    print("WA")
s = input()
print('AC' if s[0] == 'A' and s[2:len(s)-1].count('C') == 1 and all([i.islower for i in s.replace('A', '').replace('C', '')]) else 'WA')
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')
import re

S = input()
flag = 1

if S[0] == 'A':
  if S[2:-2].count('C') == 1:
    if len(re.findall('[A-Z]',S)) == 2:
      flag = 0
      print('AC')

if flag:
  print('WA')
#!/usr/bin/env python3

s = str(input())

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


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


if flag == 0:
    print("WA")
else:
    print("AC")
# B
s = input()

if s[0] == 'A' and s[1:-1].count('C') == 1:
    s = s.lstrip('A')
    s = s.replace('C', '')
    if s.islower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')
S = input()


def judge(sent):
    if sent[0] != 'A':
        return False
    if sum(['C' in s for s in sent[2:-1]]) != 1:
        return False
    if any([s.isupper() for s in sent[1] + sent[3:]]):
        return False
    return True


if judge(S):
    print('AC')
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:
    S = S.replace("A", "")
    S = S.replace("C", "")
    if S == S.lower():
        print('AC')
        quit()
print('WA')
import sys
s=input()
s=list(s)

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

c=0
for i in range(2,-2):
  if s[i]=='C':
    c+=1
    s[i]=='c'
  if c!=1:
    print('WA')
    sys.exit()

s[0]='a'

for i in s:
  if i.isupper():
    print('WA')
    sys.exit()

print('AC')
S = str(input())
alp = "ABDEFGHIJKLMNOPQRSPUVWXYZ"
if S[0] == 'A' and S.count('C') == 1 and S[2:-1].count('C') == 1:
  for i in range(1,len(S)-1):
    if S[i] in alp:
      print("WA")
      exit()
  print("AC")
else:
  print("WA")
s=input()
cnt=0
if s[0] != 'A':
    print('WA')
if s[2:len(s)].count('C') != 1:
    print('WA')
else:
    for i in range(1,len(s)):
        if s[i].isupper ==True:
            cnt+=1
    if cnt > 1:
        print('WA')
    else:
        print('AC')
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" and s != "B":
            count += 1
    if count == 2:
        flag = True
if flag:
    print("AC")
else:
    print("WA")
s = input()

if s[0] != "A" or (s[2] != "C" and s[-1] != "C"):
  print("WA")
  exit()
elif s[0] == "A" and s[2] == "C":
  s = list(s)
  s.pop(0)
  s.pop(1)
  for i in s:
    if i != i.lower():
      print("WA")
      exit()
elif s[0] == "A" and s[-1] == "C" and s[2] != "C":
  s = list(s)
  s.pop(0)
  s.pop(-1)
  for i in s:
    if i != i.lower():
      print("WA")
      exit()
      
print("AC")
s = list(input())

if s[0] == "A" and s[2:-1].count("C") == 1:
  s.remove("A")
  s.remove("C")
  for c in s:
    if c.isupper() == True:
      print(c)
      print("WA")
      exit()
    else:
      continue
  print("AC")

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 == 1 and third == 2:
    print('AC')
else:
    print('WA')
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() == 0:
          print('AC')
     else:
          print('WA')
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]

if ("".join(check_S)).islower:
    print("AC")
else:
    print("WA")
    sys.exit()
import re
S = input()
print('AC' if S.startswith('A') and (S[2:-2]).count('C') == 1 and len(re.findall('[A-Z]', S)) == 2 else 'WA')
# coding: utf-8

def isValid(target:str):
    if target[0] != "A":
        return False
    if target.count("A") != 1:
        return False
    if target.count("C") != 1:
        return False
    if target[2:len(target)-1].count("C") != 1:
        return False
    if len([i for i in target if i != "A" and i != "C" and (i <= "a" or i >= "z") ]) != 0:
        return False
    return True


if isValid(input().rstrip()):
    print("AC")
else:
    print("WA")
s = input().strip()
list_s = list(s)


def judge(s):
    if s[0] != 'A':
        return False
    list_s[0] = 'a'
    count = 0
    for idx, c in enumerate(s):
        if 2 <= idx and idx <= len(s) - 3 and c == 'C':
            count += 1
            list_s[idx] = 'c'

    if count != 1:
        return False

    return ''.join(list_s) == s.lower()


if judge(s):
    print('AC')
else:
    print('WA')
S = list(input())
L = S[2:len(S)-1]
if L.count("C") != 0 and S[0] == "A":
    print("AC")
else:
    print("WA")
S=str(input())
cnt=0
for i in range(2,len(S)-2):
    if S[i] =='C':
        cnt+=1
if cnt==1:
    if S[0]=='A':
        T = S.replace("C","").replace("A","")
        if T.islower():
            print("AC")
            exit()
print("WA")
S = input()
N = len(S)
ans = "AC"
if S[0] != 'A':
  ans = "WA"
c = 0
for i in range(1,N):
  if 2 <= i <= N-1 and 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 any(s[i] == 'C' and s[-i].islower()
       	   for i in (2, -2))\
   and (s[1]+s[3:-2]+s[-1]).islower():
      print('AC')
else:
  print('WA')
s = input()
print('AC' if s[0] == 'A' and 'C' in s[2:-1] and s.replace('A', '').replace('C', '').islower() else 'WA')
S = input()

ans = 'AC'

if S[:1] == 'A':
    if S[2:-1].count('C') == 1:
        tmp = S[1:].split('C')
        for x in tmp:
            if x.islower:
                pass
            else:
                ans = 'WA'
    else:
        ans = 'WA'
else:
    ans = 'WA'
print(ans)
s = str(input())
ans = 0
if s[0] == 'A':
    for i in range(3, len(s)-1):
        if s[i] == 'C':
            ans += 1
        if s[i].isupper():
            print('WA')
            exit()
    
    if ans == 1:
        print('AC')
        exit()
else:
    print('WA')
S = input()
print("AC" if S[0] == "A" and S[3:-2].count("C") ==
      1 and S[1:].replace("C", "", 1).islower() else "WA")
s = input()
ans = 'WA'
if s[0] == 'A':
  s = s[1:]
  if 'C' in s[1:-2]:
    s = s.replace('C' , '' , 1)
    if s.lower() == s:
      ans = 'AC'
print(ans)
s = list(input())

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

frag = True
for i in range(2,len(s)-2):
  if s[i]=='C':
    frag = False
    del s[i]
    break

if frag:
  print("WA")
  exit()
  
if not "".join(s[1:]).islower():
  print("WA")
else:
  print("AC")
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

s = s()

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

if s[1:-2].count('C')==1:
  s=s.replace('C','')
else:
  print('WA')
  exit()
  
if s.islower():
    print('AC')
else:
  print('WA')
s = str(input())
ans = 0
if s[0] == 'A':
    for i in range(3, len(s)-1):
        if s[i] == 'C':
            ans += 1
        if s[i].isupper():
            print('WA')
            exit()
        if s[1].isupper():
          print('WA')
          exit()
    
    if ans == 1:
        print('AC')
        exit()
else:
    print('WA')
s = input()
ans = 'WA'
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:
          ans = 'AC'
print(ans)
s=input()
ls=len(s)
c1=s[0]=="A"
c2=list(s[2:ls-1]).count("S")==1
if c1 and c2:
  s=s.replace("A", "a")
  s=s.replace("S", "s")
  if s.islower():
    print("AC")
  else:
    print("WA")
else:
  print("WA")
s = input()
t = 0

for i in range(0, len(s)):
  if(s[i].isupper()):
    t = t + 1
  else:
    pass

try:
  if 2 <= s.index('C') and s.index('C') <= len(s)-2:
    if t == 2:
      print('AC')
    else:
      print('WA')
  else:
    print('WA')

except ValueError:
  print('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

input = sys.stdin.readline
MOD = 1000000007

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

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


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

print("AC")
s=input()
ans="AC"
if s[0]!="A":
    ans="WA"
c=0
idx=0
for i in range(2,len(s)-2):
    if s[i]=="C":
        c+=1
        idx=i
if c!=1:
    ans="WA"
small={"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"}
for i in range(1,len(s)):
    if i!=idx:
        if s[i] not in small:
            ans="WA"
            break
print(ans)
S = input()

ans = "WA"
if S[0] == "A":
    if S[2:-2].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":
                n -= 1
                if n == len(S) - 2:
                    ans = "AC"
                    break

print(ans)
import re
S = input()
print('AC' if S.startswith('A') and (S[2] + S[-3:][0]).count('C') == 1 and len(re.findall('[A-Z]', S)) == 2 else 'WA')
s=input()
capitals=0
for i in range(len(s)):
  if ord(s[i]) in range(97-32,123-32):
    capitals+=1
    
if s[0]=="A":
  if s[2]=="C" and capitals==2:
    print("AC")
  else:
    print("WA")
else:
  print("WA")
word=input()
cflg=True
if word[0]!='A':
  cflg=False
  print(cflg)
elif word[2:-1].count('C')!=1:
  cflg=False
cnt=0
for l in word[1:]:
  if l.isupper():
    cnt+=1
else:
  if cnt!=1:
    cflg=False
  
if cflg:
  print('AC')
else:
  print('WC')
s = input()

judge = True
if s[0] != "A":
  judge = False
cnt = 0
cnt += (s[2] == "C") + (s[-2] == "C")
if cnt != 1:
  judge = False
for i, c in enumerate(s):
  if i == 0 and c == "A": continue
  if (i == 2 or i == len(s)-2) and c == "C": continue
  if c.isupper(): judge = False
print("AC" if judge else "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)-1):
    if s[i] == "C":
      s[i] = "c"
  for i in s:
    if i != i.lower():
      print("WA")
      exit()
      
print("AC")
S = input()
flag = 1
if S[0] != "A":
  flag = 0
if S[2:-2].count("C") != 1:
  flag =0
print("AC" if flag else "WA")
s=input()
ans="AC"
if s[0]!='A':ans="WA"
else:
    count=0
    for i in range(2,len(s)-1):
        if s[i]=='C':count+=1
    if count!=1:ans="WA"
print(ans)
S = list(input())
count = 0
if S[0] == 'A':
    for i in range(2,len(S)-1):
        if S[i] == 'C':
            count += 1
        elif S[i].lower != S[i]:
            print('WA')
            exit()
    if count == 1:
        print('AC')
    else:
        print('WA')
else:
    print('WA')
s = list(input())
ans = True
li = list("abcdefghijklmnopqrstuvwxyzC")

if s[0]!="A":
    ans = False
memo = s[2:-1]
if not("C" in memo):
    ans = False
for i in range(len(memo)):
    if not(memo[i] in li):
        ans = False

if ans:
    print("AC")
else:
    print("WA")
s = 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:
        print("WA")
  else:
    print("WA")
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()
n=len(s)
if n==4:
    x=s[2]
else:
    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()
ans = "AC"
if s[0] != "A":
  ans = "WA"
elif s[-1].upper() == s[-1]:
  ans = "WA"
elif s[1].upper() == s[1]:
  ans = "WA"
elif s[2:-1].count("C") != 1:
  ans = "WA"
elif not s[2:-1].replace("C", "").islower():
  ans = "WA"
  
print(ans)
s=input()

if s[0] == 'A' and 'C' in s[2:] and s.count('C') == 1:
  print("AC")
else:
  print("WA")
s=input()
if s.count("A")==1 and s.count("C")==1:
    if "C" in s[2:len(s)-1]:
        s=s.replace("A","")
        s=s.replace("C","")
        if s.isupper()==False:
            print("AC")
    else:
        print("WA")
else:
    print("WA")
# coding: utf-8
# Your code here!
import sys
s = str(input())

ch = s[0]

test_st = s[2:-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(test_stx,test_st)
        print('AC')
    else:
        print('WA')
else:
    print('WA')
#!/usr/bin/env python3

s = str(input())

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


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

if flag == 0:
    print("WA")
else:
    print("AC")
s=input()
flag=0
if s[0]=="A":
    ss=s[2:-1]
    if ss.count("C")==1:
            ss=ss.replace("C","c")
            if ss.islower() and s[1].islower():
                    print("AC")
                    flag=1
if flag==0:
    print("WA")
S = input()
CS = S[2:-1]
print(CS)
if S[0] == 'A':
  S = S.lstrip('A')
  if CS.count('C') == 1:
    S = S.replace('C', '')
    if S.islower() == True:
      print('AC')
    else:
      print('WA')
  else:
    print('WA')
else:
  print('WA')
s=input()
lenlen=len(s)
count=0
if s[0]=="A":
  t=s[2:lenlen-1]
  for i in range(0,len(t)):
    if t[i]=="C":
      count+=1
  if count==1:
    tttt=0
    for j in range(0,lenlen):
      if not 97<=ord(s[j])<=122:
        tttt+=1
    if tttt==2:
      print("Yes")
    else:
      print("No")
  else:
    print("No")
else:
  print("No")
S=str(input())
temp=0
j=0
if S[0]!='A':
    print('WA')
    exit()
for i in range(2,len(S)-3):
    if S[i]=='C':
        temp+=1
        j=i
if temp!=1:
    print('WA')
    exit()
for i in range(len(S)):
    if i!=0 and i!=j:
        if S[i].isupper():
            print('WA')
            exit()
print('AC') 
exit()
s = input()
ans = 'WA'

if 'A' in s[0] and 'C' in s[2:-2]:
    if s.find('C') != 1 and s.count('C') == 1:
        ans = 'AC'

print(ans)
s = input()
print('AC' if 'A' in s and 'C' in s[2:-1] and s[1:].replace('C', '').islower() else 'WA')
strs=input()
che=True
c=True
coun=False
for i in range(0,len(strs)) :
    if(i==0):
        c=True if strs[i]=="A" else False
    else :
        if(strs[i].isupper()):
            if( (not coun) and i>=2 and i<=len(strs)-3 and strs[i]=='C'):
                coun=True
            else:
                che=False
print("AC") if che and coun and c else print("WA")
s = input()
ans = 'WA'

if s[0] == 'A':
    if s[2:-2].count('C') == 1:
        index = s[2:-2].find('C') + 2
        if s[1:index].islower() and s[index + 1:].islower():
            ans = 'AC'
print(ans)
s=input()
if s[0]!="A":
    print("WA")
elif "C" not in s[2:] or s[2:].count("C")!=1:
    print("WA")
elif s[1:].strip("C")==str.lower(s[1:].strip("C")):
    print("AC")
    
else:
    print("WA")
s=input()
if s[0]=="A" and s[2:len(s)-1].count("C")==1:
	print("AC")
else:
	print("WA")
S = str(input())
    
result = False
    
if S[0] == 'A':
    
    check = S[2:len(S)-1]
    
    if check.count('C') == 1:
        
        result = S[1:]
        
        result = result.replace('C','')
        
        if result.islower():
            result = True
            
if result:
    print('AC')
else:
    print('WA')
S = input()
flag = 0
flag_of_flag = 0
now = 0
komoji = 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":
  flag += 1
for i in range(2,len(S)-1):
  if S[i] == "C":
    now += 1
  elif S[i] in k:
    komoji += 1
if now == 1:
  flag += 1
if S[1] in k and S[len(S)-2] in k and S[len(S)-1] in k:
  komoji += 3
if flag == 2:
  if komoji == len(S)-2:
    print("AC")
  else:
    print("WA")
else:
  print("WA")
s = input()
if s[0] == 'A':
  t = ''
  for i in range(1, len(s)):
    if s[i] != 'C':
      t += s[i]
  if t.islower() and 'C' in s[2:]:
    print('AC')
  else:
    print('WA')
else:
  print('WA')
s = list(input())

bl = True

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

print('AC' if bl else 'WA')
S = input()
flg1 = flg2 = flg3 = True
if not S[0] == 'A':
    flg1 = False
if not S.count('C', 2, -2) == 1:
    flg2 = False
j = len(S) + 1
for i in range(len(S)):
    if S[i] == 'C':
        j = i
for i in range(len(S)):
    if i == 0 or i == j:
        continue
    else:
        if S[i].islower() == False:
            flg3 = False
flg = flg1 * flg2 * flg3
print('AC' if flg else 'WA')
s = input()
if s[0]=="A" and s[2:-2]=='C':
    print('AC')
else:
    print('WA')
a = input()
b = a[2:len(a)-1]
if a[0] == "A" and b.count("C") == 1:
  print("AC")
else:
  print("WA")
import re

txt = input()
z = re.match("A[a-z]+C[a-z]+", txt)

print("AC" if z else "WA")
s = list(input())

if s[0] == "A" and s[2:-1].count("C") == 1:
    s.remove("A")
    s.remove("C")
    
    if "".join(s).lower() == "".join(s):
        print("AC")

else:
    print("WA")
s=list(input())
print('AC' if (s[0]=='A') and ('C' in s[2:-1]) and all(i.islower for i in s if not i in ['A','C']) and (s.count('A')==s.count('C')==1) else 'WA')
s = list(input())
print(s)
if s[0] == 'A' and s[2:-1].count('C') == 1 and s.count('C') == 1:
     s.remove('A')
     s.remove('C')
     print(s)
     if str(s).islower() == 0:
          print('AC')
     else:
          print('WA')
else:
     print('WA')
s=input()
if s[0]!='A':
    print("WA")
    exit()
if s[2:len(s)-1].count('C')!=1:
    print("WA")
    exit()
idx=s.index('C')
for i in range(1,len(s)):
    if i==idx:
        break
    if not(s[i]>='a' and s[i]<='z'):
        print("WA")
        exit()
print("AC")
s=input()
yn=0
if s.count("C")==1 and s[0]=="A" and s[1]!="C" and s[len(s)-1]!="C":
    for i in range(2,len(s)-1):
        if ord(s[i])<96:
            if s[i]!="C":
                yn=1
    if yn==1:
        print("No")
    else:
        print("Yes")
else:
    print("No")
s = 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 = list(s)
        s.remove("A")
        s.remove("C")
        a = ",".join(s)
        if a.islower() == True:
            print("AC")
    else:
        print("WA")
else:
    print("WA")
S = input().rstrip()
cnt = 0
for s in S[2:-1]:
    if s == "C":
        cnt += 1
    else:
        if not s.islower():
            print(s)
            print("WA")
            exit()
if cnt == 1 and S[0] == "A" and S[1].islower():
    print("AC")
else:
    print("WA")
s = input()
if s[0] == 'A':
  t = ''
  c_cnt = 0
  for i in range(1, len(s)):
    if s[i] != 'C':
      t += s[i]
    else:
      c_cnt += 1
  if t.islower() and 'C' in s[2:] and c_cnt == 1:
    print('AC')
  else:
    print('WA')
else:
  print('WA')
S = input()
if S[0] != 'A':
    print('WA')
    exit()
if S[2:].count('C') != 1:
    print('WA')
    exit()
for i in range(len(S)):
    if i in [0, 2]:
        continue
    if S[i] != S[i].lower():
        print('WA')
        exit()
print('AC')
S = list(input())
a_flag = 0
c_flag = 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
    elif S[i] == 'C':
        c_flag += 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:
    print('AC')
else:
    print('WA')
S = str(input())
    
result = False
    
if S[0] == 'A':
    
    check = S[1: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')
s=input()
ans="WA"
if s[0]=="A":
    if s[2:-1].count("C")==1:
        s=list(s)
        s.remove("A")
        s.remove("C")
        for j in range(len(s)):
            if ord(s[j])>ord("z"):
                break
        else:
            ans="AC"
print(ans)
s=input()
count=0
for i in range(2,len(s)):
    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")