peterverebics/CodeNet_Python_118 huggingface dataset:
s = input()
ans = "AC"
c = 0
for i in range(len(s)):
    if i==0 and s[i]!="A":
        ans = "WA"
    if i>=2 and i<len(s)-1:
        if s[i]=="C":
            c += 1
        elif ord(s[i])>=65 and ord(s[i])<=90:
            ans = "WA"
    if i==1 or i==len(s)-1:
        if ord(s[i])>=65 and ord(s[i])<=90:
            ans = "WA"
if c!=1:
    ans = "WA"
print(ans)
s = str(input())
flag = 0
C_count = 0
flag_2 = 0
mode = 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")
# ABC104B - AcCepted
def main():
    S = input().rstrip()
    flags = [S[0] == "A", S[2:-1].count("C") == 1, S.translate(str.maketrans({"A": None, "C": None})).islower()]
    print("AC" if all(flags) else "WA")


if __name__ == "__main__":
    main()
s=list(input())

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

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

print("WA")
import string

s = list(input())
flag = True
if s[0] != "A":
    flag = False
count = 0
for i in range(1, len(s)):
    if s[i] in string.ascii_uppercase:
        if i == 1 or i == len(s) - 1 or s[i] != "C":
            flag = False
        count += 1

if flag and count == 1:
    print("AC")
else:
    print("WA")
s = input()
if s[0]=='A' and 'C' in s[2:-1]:
    s = s.replace('A','',1).replace('C','',1)
    if s == s.lower():
        exit(print('AC'))
print('WA')
s = input()

if s[0] == "A" and s[2:-1].count("C") == 1:
  idx_C = s[2:-1].index("C") + 2
  s = s[1:idx_C] + s[idx_C+1:]
  if s.lower() == s:
    print("AC")
    exit()
print("WA")
S = input()
count = 0
flag = False
if S[0] == "A":
    # print(S[2:-1]) #指定部分獲得できる
    tmp = S[2:-1]
    lower = S[1:]
    for i in range(len(tmp)):
        if tmp[i] == "C":
            count += 1
    if count == 1:
        tmpS = S.replace("A","a")
        tmpSS = tmpS.replace("C","c")
        if tmpSS.islower():
            flag = True

if flag:
    print("AC")
else:
    print("WA")
S = input()
if S[0] == 'A' and 'C' in S[2:-1]:
    idx = S.index('C')
    if all(c.islower() or i in (0, idx) for i, c in enumerate(S)):
        print('AC')
    else:
        print('WA')
else:
    print('WA')
s = input()
if s[0]=="A":
    checker = 0
    for i in range(2, len(s)-1):
        if s[i] =="C":
            checker += 1
    if checker == 1:
        checker = 0
        for i in range(len(s)):
            if ord(s[i])<97:
                checker += 1
        if checker == 2:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")
s = input()
length = len(s)
cnt = 0

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

if length == 4:
    if s[2] == 'C':
        cnt = 1
else:
    for i in range(2, length-1):
        cnt += 1 if s[i] == 'C' else 0

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

up_cnt = 0
for c in s:
    if c.isupper():
        up_cnt += 1

if up_cnt != 2:
    print('WA')
    exit()

print('AC')
s = input()
count = 0
flag = 0

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

if s[0] == 'A':
    for i in range(2 , len(s)-1):
        #print(s[i])
        if s[i] == "C" and count == 2:
            flag = 1
if flag == 1:
    print("AC")
else:
    print("WA")
S=input()
Sdash=[]
for i in range(2,len(S)-1):
    Sdash.append(S[i])
a=0
for i in range(len(S)):
    if S[i].islower()==True:
        a+=1
if S[0]=='A' and Sdash.count('C')==1 and a==len(S)-2:
    print('AC')
else:
    print('WA')
import sys
from collections import Counter
readline = sys.stdin.buffer.readline
MOD = 10**9+7
INF = float('inf')

def main():
    S = list(readline().rstrip().decode('utf-8'))

    bl = S[0] == 'A'
    bl &= ('C' in S[2:-1])

    if bl:
        S.remove('A');
        S.remove('C')

    bl &= all('a' <= x <= 'z' for x in S)

    answer = 'AC' if bl else 'WA'
    print(answer)




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

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

print("WA")
s = input()
n = len(s)
for i in range(1, n):
    if ord(s[i]) < 97 and s[i] != "C":
        print("WA")
        exit()
cnt_c = 0
for i in range(2, n - 1):
    if s[i] == "C":
        cnt_c += 1
if cnt_c != 1:
    print("WA")
    exit()
print("AC" if s[0] == "A" else "WA")
import sys
s = input()

l = len(s)
if s[0] != "A":
    print("WA")
    sys.exit()
ss =  s[2:l-1]
if ss.count("C") != 1:
    print("WA")
    sys.exit()

cidx = ss.find("C")+2
sss = s[1:cidx]+s[cidx+1:]
if sss.islower():
    print("AC")
    sys.exit()

print("WA")
s=input()

n = len(s)

countC = 0

alf = [chr(ord('a') + i) for i in range(26)]

for i in range(n):
    #print(i)
    if i == 0 and s[i] != 'A':
        print('WA')
        exit()
    elif i == 0 and s[i] == 'A':
        continue
    elif s[i] == 'C' and 1 < i and i < n-1:
        countC += 1
    elif s[i] in alf:
        continue
    else:
        print('WA')
        exit()
    
if countC == 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")
else:
    print("WA")
def myAnswer(S:list)->str:
   if(S.pop(0) !="A"): return "WA"
   flag = False
   for n,s in enumerate(S):
      if(n>=1 and n <= len(S)-2 and flag==False and s=="C"):
         flag = True
      else:
         if(s.isupper()):
            return "WA"
   return "WA" if(flag==False) else "AC"


def modelAnswer():
   tmp=1
def main():
   S = list(input())
   print(myAnswer(S))
if __name__ == '__main__':
   main()
s=input()

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

k=s[2: -1]
if k.count("C")==1:
    pass
else:
    print("WA")
    exit()

new_string=s.replace("A", "")
new_string=new_string.replace("C", "")

if new_string.islower():
    print("AC")
else:
    print("WA")
S = input ()
T = S.replace('A', '')
T = T.replace('C', '')
U = T.lower ()
if S[0]=='A' and S.count('A')==1 and S[2:-1].count('C')==1 and S.count('C')==1 and T==U:
  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')
#ABC104_B
S = input()

ans = "AC"

if S[0] != 'A' or S[2:-1].count('C') != 1 or S[-1] == 'C' or S[1] == 'C':
  ans = "WA"
for i in range(1, len(S)):
  if S[i].isupper() and S[i] != 'C':
    ans = "WA"
print(ans)
s = list(input())
alpha = [chr(i) for i in range(97, 97+26)]

flag = True
if s[0] != "A" or (not "C" in s[2:-1]):
  flag = False
  
else:
  cin = s.index("C")
  for i in range(len(s)):
    if i == 0 or i == cin:
      continue

    if (not s[i] in alpha):
      flag = False
      break
    
print("AC" if flag else "WA")
S = list(input())

if S[0] == 'A' and S[2:-1].count('C') == 1:
    S.pop(S[2:-1].index('C')+2)
    S.pop(0)
    if ''.join(S) == ''.join(S).lower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')
s = input()
if s[0] == "A" and  "C" in s[2:-1] and s[1:].replace("C","",1).islower():
    print("AC")
else:
    print("WA")
import math
def main():
  s = input()
  flg=0
  if s[0]=='A':
    if s[2:len(s)-1].count('C')==1:
      s=s.replace('C','c')
      if s[1:].islower():
        print("AC")
        flg=1
  if flg==0:
    print("WA")
main()
s = input()
if s[0] == "A" and s[2:-1].count("C")==1:
    c = s[2:-1].index('C')
    if (s[1]+s[2:c+2]+s[c+3:]).islower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')
s = list(input())
j= 2
count = 0
if not s[0] == 'A':
    print('WA')
    exit()

for i in s[2:-1]:
    if i == 'C':
        count += 1
        tmp = j
    j += 1
if not count == 1:
    print('WA')
    exit()

del s[0]
del s[tmp-1]
s = ''.join(s)

if s.islower():
    print('AC')
    exit()

print('WA')
S = input()
sl = []
ans = 'AC'

for i in S:
    sl.append(i)
if S[0] != 'A':
    ans = 'WA'
if S[2:-1].count('C') != 1:
    ans = 'WA'

if S[1:].replace("C","c",1).islower() == False:
    ans = 'WA'
#print(sl)
print(ans)
S = input()
flag = True
cflag = False
for i, c in enumerate(S):
    if i == 0:
        if c == "A":
            continue
        else:
            flag = False
            break

    if c == "C" and 2 <= i < len(S)-1:
        if cflag:
            flag = False
        cflag = True

    elif not (97 <= ord(c) <= 122):
        flag = False


if flag and cflag:
    print("AC")
else:
    print("WA")
S = input()
if S[0] == "A":
    S_1 = S[1:]
    if S[2:-1].count("C") == 1:
        S_1 = S_1.replace("C", "", 1)
        if S_1.islower():
            print("AC")
            exit()
print("WA")
import string

S = input()
re_S = set(S)-set("AC")
bl = S[0] == "A"
bl &= (S[2:-1].count("C") == 1)
bl &= (re_S <= set(string.ascii_lowercase ))

print("AC" if bl else "WA")
s = input()
if not s[0]=="A":
  print("WA")
elif not s[1].islower():
  print("WA")
else:
  cnC = 0
  for i in range(2,len(s)-1):
    if s[i]=="C":
      cnC += 1
    elif s[i].isupper():
      print("WA")
      quit()
  if cnC==1 and s[len(s)-1].islower():
    print("AC")
  else:
    print("WA")
import sys

S = input()

count = 0
for i in range(len(S)):
    if i == 0 and S[i] != "A":
        print("WA")
        sys.exit()

    if i == len(S)-1 and count != 1:
        print("WA")
        sys.exit()

    if i != 0 and i != len(S)-2 and S[i].isupper() and S[i] != "C":
        print("WA")
        sys.exit()

    if i >= 2 and i <= len(S)-2 and S[i] == "C":
        count += 1

print("AC")
import sys
S=input()
first=S[0]
second=S[1]
last=S[len(S)-1]
cnt=0
moji=[i for i in "abcdefghijklmnopqrstuvwxyz"]
# print(len(moji))

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 and ((last in moji)==True) and ((second in moji)==True):
    print("AC")
  else:
    print("WA")
        
else:
  print("WA")
A=input()
if A[0] != "A":
  print("WA")
  quit()
if A[2:-1].count("C") != 1:
  print("WA")
  quit()
for i in range(1,len(A)):
  if A[i] !="C" and not A[i].islower():
    print("WA")
    break
else:
  print("AC")
S=list(input())

ans = 'AC'

#条件１
if S[0] != 'A':
    ans = 'WA'

#条件2
C_cnt=0
for s in S[2:-1]:
    if s=='C':
        C_cnt+=1
    
if C_cnt != 1:
    ans = 'WA'
    
#条件3
Up_cnt=0
for s in S:
    if s.isupper()==True:
        Up_cnt+=1
if Up_cnt != 2:
    ans = 'WA'
    
print(ans)
S = list(input())

if S[0] != "A":
    print("WA")
elif S[2:-1].count("C") != 1:
    print("WA")
else:
    S.remove("A")
    S.remove("C")
    S = "".join(S)
    if S.islower():
        print("AC")
    else:
        print("WA")
def main():
    S = input()

    if S[0] == 'A':
        count = 0
        for i in range(2, 2+len(S[2:-1])):
            if S[i] == 'C':
                count += 1
                index = i
        if count == 1:
            S = S[1:index]+S[index+1:]
            if S.islower():
                print('AC')
                return
    print('WA')


if __name__ == '__main__':
    main()
S=input()
if S[0]=="A":
  c=0
  d=0
  for x in range(2,len(S)-1):
    if S[x].islower():
      d+=1
    if S[x]=="C":
      c+=1
  if c==1 and d==len(S)-4 and S[1].islower() and S[len(S)-1].islower():
    print("AC")
  else:
    print("WA")
else:
  print("WA")
import sys
s = input()
ans = 'AC'
c = 0
if s[0] != 'A':
    ans = "WA"
for i in range(2,len(s)-1):
    if "C" == s[i]:
        c += 1
if c != 1:
    ans = "WA"
c = 0
for i in range(len(s)):
    a = ord(s[i])
    if 65 <= a and a <= 96:
        c += 1
if c != 2:
    ans = "WA"
print(ans)
import re
s = input()

s1 = re.fullmatch(r"A([a-z]+)C([a-z]+)", s)

if s1 == None:
    print("WA")
else:
    print("AC")
s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1 and (s[1:s.find('C')]+s[s.find('C')+1:]).islower():
    print('AC')
else:
    print('WA')
s=input()
n=len(s)
if n==4:
    x=s[2]
else:
    x=s[2:n-1]
    
if s[0]!='A':
    print('WA')
    
elif x.count('C')!=1:
    print('WA')
    
else:
    i=x.find('C')
    s=list(s)
    s.pop(i+2)
    s.pop(0)
    s=''.join(s)
    if s.islower()==True:
        print('AC')
    else:
        print('WA')
s = input()

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

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

s = s[1:]
s = s.replace('C', '')
for x in s:
   if (x.islower() == False):
      print('WA')
      exit()
print('AC')
S = input()
print("AC" if(S[0] == "A" and 'C' in S[2:-1]
              and S[1:].replace("C", '', 1).islower()) else "WA")
s=input()
print('AC' if s[0] == 'A' and s[2:-1].count('C') ==1 and s[1:].replace('C','',1).islower() else 'WA')
import re


def answer(s: str) -> str:
    pattern = r'^A[a-z]+C[a-z]+$'
    return 'AC' if re.match(pattern, s) else 'WA'


def main():
    s = input()
    print(answer(s))


if __name__ == '__main__':
    main()
s=input()
AC="AC"
if not s[0]=="A":
  AC="WA"
s=s[1:]  
if not s[1:-1].count("C")==1:
  AC="WA"
s=s.replace("C","c")


if not s.islower():
  AC="WA"
  
print(AC)
S = input()

if S[0] == "A" and "C" in S[2:-1] and S.count("C") == 1 and len([s for s in S if s.isupper()]) == 2:
    print("AC")
else:
    print("WA")
S = input()
if S[0] == "A":
    if S[2:-1].count("C") == 1:
        S2 = S.replace("A","")
        S3 = S2.replace("C","")
        if S3.islower() == True:
            ac = True
        else:
            ac = False
    else:
        ac = False
else:
    ac = False
if ac == True:
    print("AC")
else:
    print("WA")
s = input()
cnt = 0
if s[0] == "A" and s[2:-1].count("C") == 1:
    for i in range(len(s)):
        if ord(s[i])<=90:
            cnt += 1
    if cnt != 2:
        print("WA")
        quit()
    else:
        print("AC")
else:
    print("WA")
S = input()

flag = 1
c_count = 0
ans = 'AC'
if S[0] != 'A':
  ans = 'WA'
for i in range(1,len(S)):
  if (i == 1 or i == len(S)-1) and S[i].islower() == False:
    ans = 'WA'
  elif 2 <= i <= len(S)-2:
      if S[i] == 'C':
        c_count += 1
if c_count != 1:
  ans = 'WA'
print(ans)
s = list(input())

#chr(ord('a')

ans = True
if s[0] != "A":
    print("WA")
elif s[2:-1].count("C") != 1:
    print("WA")
else:
    s.remove("A")
    s.remove("C")
    if not str(s).islower():
        print("WA")
    else:
        print("AC")
s = input()
def cntUpper(s):
    cnt = 0
    for a in s:
        if a.isupper():
            cnt += 1
    return cnt
print('AC') if s[0] == 'A' and 'C' in s[2:-1] and cntUpper(s) == 2 else print('WA')
#abc104 b
s=input()
x=s[2:-1]
flag=True
if s[0]!="A" or s[1].isupper() or s[-1].isupper():
    flag=False
cnt=0
for i in range(len(x)):
        if x[i]=="C":
            cnt+=1
        else:
            if x[i].islower()==False:
                flag=False
if cnt!=1:
    flag=False
if flag:
    print("AC")
else:
    print("WA")
S = input()
ans = "WA"
if S[0] == "A":
    tmp = S[2:len(S)-1]
    if tmp.count("C") == 1:
        c = tmp.index("C")
        count = 0
        for i in range(1,len(S)):
            tmp2 = S[i]
            if tmp2.islower():
                count += 1
        if count == len(S) - 2:
            ans = "AC"
print(ans)
s = input()


def check(w):
    if w[0] != 'A':
        return False
    n = len(w)
    count = 0
    for a in range(2, n-1):
        if w[a] == 'C':
            count += 1
    if count != 1:
        return False
    upper = 0
    for a in range(0, n):
        if w[a] >= 'A' and w[a] <= 'Z':
            upper += 1

    if upper != 2:
        return False
    return True


if check(s):
    print('AC')
else:
    print('WA')
s=(input())
k=s[2:-1]
m=k.replace('C', 'c')
t=s[-1]
t1=s[1]
if k.count('C')==1 and s[0]=='A' and m==k.lower() and t==s[-1].lower() and s[1]==t1.lower():
    print('AC')
else:
    print('WA')
S = input()
n =len(S)
s = S.lower()


if S[0] != 'A':
  print('WA')
  exit()
else:
  for i in range(2, n-1):
    if S[i] != 'C':
      if S[i] != s[i]:
        print('WA')
        exit()
      
if S[n-1] != s[n-1] or S[1] != s[1]:
  print('WA')
  exit()
  
if S.count('C') != 1:
  print('WA')
  exit()
  
print('AC')
s = input()
is_a = False
cnt_c = s[2:-1].count("C")
cnt_l = 0
if s[0] == "A":
    is_a = True
else:
    pass
for letter in s:
    if letter.isupper():
        cnt_l += 1
    else:
        continue
if is_a == True and cnt_c == 1 and cnt_l == 2:
    print("AC")
else:
    print("WA")
S = input()

ans = "WA"

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

print(ans)
s = input()

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

input = sys.stdin.readline
MOD = 1000000007

S = input()[:-1]

S = list(S)

if S[0] == 'A':
    if 'C' in S[2:-1] and  S.count('C') == 1:
        x = []
        for i in range(1,len(S)):
            if S[i] == 'C':
                continue
            x.append(S[i])
        
        #print(x)
        if str(x).islower():
            print("AC")
            exit()

print("WA")
import re
S = input()
print('AC' if S.startswith('A') and (S[2:-1]).count('C') == 1 and len(re.findall('[A-Z]', S)) == 2 else 'WA')
s = input()

def has_A(x):
    if x[0] == 'A': return True
    return False


def has_C(x):
    if x[2:-1].count('C') == 1: return True
    return False


def is_lower_this_case(x):
    i = x.index('C')
    if x[1:i].islower() and x[i+1:].islower():
        return True
    return False

if has_A(s) and has_C(s) and is_lower_this_case(s):
    print('AC')
else:
    print('WA')
s = list(input())
flg = 'WA'
if s[0] == 'A':
    if 'C'in s[2:len(s)-1]:
        s.remove('A')
        s.remove('C')
        s = ''.join(s)
        if s.islower() == True:
            flg = 'AC'
print(flg)
s = input()
a = s.lower()
l = len(s)
c = 0
n = 0

if s[0] == 'A':
  for i in range(2 , l-1):
    if s[i] == 'C':
      c += 1
  if c == 1:
    for i in range(1,l):
      if s[i] != a[i]:
        n += 1
    if n == 1:
      print('AC')
      exit()
print('WA')
S = input()
 
 
if S[0] != "A":
    print("WA")
 
elif "C" in S:
    a = S.index("C")
 
    if 2 <= a <= len(S)-2:
        S = S.replace("A", "", 1).replace("C", "", 1)
        
        if S.islower():
            print("AC")
        
        else:
            print("WA")
 
    else:
        print("WA")
 
else:
    print("WA")
import re
print('AC' if re.match('^A[a-z]+C[a-z]+$', input()) else '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")
def resolve():
	s = input()
	if s[0] != 'A':
		print('WA')
		return
	cnt = False
	for i in s[2:-1]:
		if i == 'C':
			cnt += 1
	if cnt != 1:
		print('WA')
		return
	for i in s:
		if i == 'A' or i == 'C':
			continue
		if i.isupper():
			print('WA')
			return
	print('AC')
resolve()
S=input()
if S[0]=='A' and S[2:-1].count('C')==1:
    s=list(S)
    s.remove('C')
    S=''.join(s)
    if S.istitle()==True:
        print('AC')
        exit()
print('WA')
def isAC(S):
    if S[0] != 'A':
        return False
    if S[2:-1].count('C') != 1:
        return False
    S = S[1:].replace('C', '')
    if not all('a' <= x <= 'z' for x in S):
        return False
    return True

print('AC' if isAC(input()) else 'WA')
list_S = list(input())
ans = "WA"
if list_S[0] == "A":
    list_S.remove("A")
    if "C" in list_S[1:-1]:
        list_S.remove("C")
        for c in list_S:
            if c not in ["q","a","z","w","s","x","e","d","c","r","f","v","t","g","b","y","h","n","u","j","m","i","k","o","l","p"]:
                ans = "WA"
                break
            else:
                ans = "AC"

print(ans)
import fileinput

s = list(input())

if s[0] != "A" or s[1].isupper() or s[len(s) - 1].isupper():
    print("WA")
    exit()

cc = False
for i in range(2, len(s) - 1):
    if s[i] == "C" and not cc:
        cc = True
        continue
    if s[i] == "C" and cc:
        print("WA")
        exit()
    if s[i].isupper() and s[i] != "C":
        print("WA")
        exit()

if cc:
    print("AC")
else:
    print("WA")
s = input()
if s[0]!='A' or s[2:-1].count('C')!=1:
    print('WA')    
else:
    cnt = 0
    for i in s:
        if i<'a' or 'z'<i:
            cnt += 1
    if cnt==2:
        print('AC')
    else:
        print('WA')
s=list(input())
if s[0]=="A" and s[2:len(s)-1].count("C")==1:
    s[0]="a"
    s[s.index("C")]="c"
    if "".join(s).islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

S = sr()
bl = True
if S[0] != 'A':
    bl = False
if S[2:-1].count('C') != 1:
    bl = False
if S.count('C') != 1:
    bl = False
for s in S[1:]:
    if s == 'C':
        continue
    if not s.islower():
        bl = False    

print('AC' if bl else 'WA')
s = input()
length = len(s)
count = 0
count_large = 0
sep = s[2:length-1]


if s[0] == 'A':
    count += 1

if sep.count('C') == 1:
    count += 1

for i in range(length):
    if s[i].isupper():
        count_large += 1
        
if count_large == 2:
    count += 1

if count == 3:
    print('AC')
else:
    print('WA')
S = input()
cnt = 0
if S[0] == "A":
    for i in S[2: len(S) - 1]:
        if i == "C":
            cnt += 1
sr = S.replace("A", "")
src = sr.replace("C", "")
if src.islower() and cnt == 1:
    print("AC")
else:
    print("WA")
s=input()
print('AC' if s[0]=='A' and s[2:-1].count('C')==1 and s[1].islower() and s[1:].replace('C','',1).islower() else 'WA')
s = input()
print("AC" if 'C' in s[2:-1] and 'A' in s and s[1:].replace('C', '', 1).islower() else "WA")
S = input()
if S[0] == "A":
    count = 0
    S2 = S[2:-1]
    for i in S2:
        if i == "C":
            count += 1
    if count == 1:
        S3 = S[1:].replace("C","")
        if S3.islower():
            print("AC")
            exit()
print("WA")
S = input()
if S[0] != "A":
  print("WA")
  exit()
elif S[2:-1].count("C") != 1 or S[:2].count("C") != 0 or S[-1:].count("C") != 0:
  print("WA")
  exit()
else:
  S = S[1:].replace("C", "")
  if S.islower():
    print("AC")
  else:
    print("WA")
S = input()
if S[0] == "A":
    S_cpy = S.lstrip("A")
else:
    print("WA")
    exit()

if S[2:-1].count("C") == 1:
    S_cpy = S_cpy.replace("C", "")
else: 
    print("WA")
    exit()

if S_cpy.islower():
    print("AC")
else:
    print("WA")
import re
S=input()
good = True

if S[0] != 'A':
    print('WA')
    exit()
n = 0
iC = -1
for i in range(2,len(S)-1):
    if S[i] == 'C':
        n += 1
        iC = i
if n != 1:
    print('WA')
    exit()
for i in range(1,len(S)):
    if i == iC:
        continue
    if not re.match(r'[a-z]', S[i]):
        print('WA')
        exit()

print('AC')
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)-2 and strs[i]=='C'):
                coun=True
            else:
                che=False
print("AC") if che and coun and c else print("WA")
s = list(input())
if s[0]=='A':
    s.remove(s[0]);   l = len(s)
    for i in range(l):
        if s[1:l-1].__contains__('C'):
            s.remove('C')
            print('AC' if str(s) == str(s).lower() else 'WA');   break
        else:
            print('WA');   break
else:
    print('WA')
import re

def solve():
    S = input()
    print('AC' if re.match(r'^A[a-z]+C[a-z]+$', S) else 'WA')

if __name__ == "__main__":
    solve()