peterverebics/CodeNet_Python_118 huggingface dataset:
s=input()
if s[0]!="A":
    print("WA")
elif "C" not in s[2:len(s)-1] or s[2:len(s)-1].count("C")!=1:
    print("WA")
elif s[1]==str.upper(s[1]):
    print("WA")
elif s[2:].strip("C")==str.lower(s[2:].strip("C")):
    print("AC")
else:
    print("WA")
S = input()
rs = 'WA'
if S[0] == 'A' and S[2:-2].count('C')==1:
    S = S[1:2]+S[2:-2].replace('C', '')+S[-2:]
    if S.islower():
        rs = 'AC'
print(rs)
s = input()
n = len(s)
res = []
if s[0] == 'A':
  if s.find('C') >= 2 or 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 = 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)-2):
  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 = str(input())
alp = "ABDEFGHIJKLMNOPQRSTUVWXYZ"
if S[0] == 'A' and S.count('C') == 1 and S[2:-1].count('C') == 1:
  for i in range(1,len(S)):
    if S[i] in alp:
      print(S[i])
      print("WA")
      exit()
  print("AC")
else:
  print("WA")
s=input()
if s[0] != 'A':
    print('WA')
    exit()
if s[2:-2].count('C') != 1:
    print('WA')
    exit()
for i in range(1,len(s)):
    if s[i]=='C':
        continue
    if s[i].isupper() == True:
        print('WA')
        exit()
print('AC')
s = input()

if (s[0] == 'A') and s[2:-1].count('C') == 1:
    print('AC')
else:
    print('WA')
s = input()
length = len(s)
cnt = 0

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

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

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

print('AC')
exit()
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 = ['a' if i == 'C' else i for i in s]
if "".join(wk).isupper():
    ans = 'WA'

print(ans)
import sys
s = input()
if s[0] == "A" and  "C" in s[2:-1]:
    s = s[1:].replace("C","",1)
    if s[1:].islower():
        print("AC")
        sys.exit()
print("WA")
S=str(input())
temp=0
j=0
if S[0]!='A':
    print('WA')
    exit()
for i in range(2,len(S)-2):
    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()
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    S=input()
    if S[0]=='A' and S[2:-1].count('C')==1:
        print('AC')
    else:
        print('WA')

if __name__ == '__main__':
    main()
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[2:-1].replace('C','')+s[-1]
  if s.islower==False:
    ans='WA'
print(ans)
import re
ans=re.match("^A[a-z]+C[a-z]+",input())
print("AC" if ans else "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)-4 and upp == 0:
  print("AC")
else :
  print("WA")
import sys
S = input()
if S[0] != 'A':
    print('WA')
    sys.exit()
    
n = len(S)
ct = 0
for i in range(1, n):
    if S[i].islower():
        if i == 1 or i == n - 1 or S[i] != 'C':
            print('WA')
            sys.exit()
        ct += 1
if ct == 1:
    print('AC')
else:
    print('WA')
s = input()

result = 'WA'
count = 0
tmp = ''
if s[0] == 'A':
    for i in range(2,len(s)-1):
        if s[i] == 'C':
            count += 1
        elif s[i] != 'A':
            tmp += s[i]

    if count == 1 and tmp.islower():
        result = 'AC'

print(result)
S = input()
flag = True
if S[0] != 'A':
    flag = False
if S.count('C') != 1 or 'C' not in S[2:-2]:
    flag = False
if S.replace('A', 'a').replace('C', 'c').islower() != True:
    flag = False
print('AC' if flag else 'WA')
s = input()
if s[0]=="A" and s[2:-2].count("C")==1 and s.count("C")==1:
  print("AC")
else:
  print("WA")
s = list(input())
if s[0] != "A" or s.count("A") != 1 or s.count("C") != 1 or s[2:-1].count("C") != 1:
    print("WA")
else:
    print("AC")
# 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')
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):
    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()

if(s[0] == "A"):
    if(s[2:len(s)-1].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
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

S = list(input())

print("AC" if (S[0] == 'A' and len(list(filter(lambda x : x == 'C', S[2:]))) == 1 and S[1] != 'C' and S[-1] != 'C') else "WA")
def main():
    S = input()
    L, R = 2, len(S) - 2
    cnt = 0
    for i in range(len(S)):
        if S[i] == 'A' and i == 0:
            continue
        if S[i] == 'C' and L <= i <= R:
            cnt += 1
            continue
        if S[i].isupper():
            print('WA')
            exit()

    if cnt != 1:
        print('WA')
    else:
        print('AC')


if __name__ == '__main__':
    main()
s=input()
if s[0]=="A":
    count=0
    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 = 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].islower():
        ans = False


if ans:
    print('AC')
else:
    print('WA')
s = input()
ans = "WA"
cnt = s[2:-1].count("C")
if s[0] == "A" and "C" in s[2:-1] and cnt == 1:
    ans = "AC"
else:
    pass
print(ans)
#!/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")
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":
                pass 
            elif S[i].isupper() == True:
                n -= 1
                break
        if n == len(S):
            ans = "AC"

print(ans)
from collections import Counter
s = input()
fist = s.replace('A', '').replace('C', '')

if not fist.islower():
    print('WA')
else:
    seco = s[2:-2]
    cnt = Counter(seco)
    if not cnt['C'] == 1:
        print('WA')
    else:
        if s[0] == 'A':
            print('AC')
        else:
            print('WA')
print("a", ord("a"))
print("z", ord("z"))

s = input()
n = len(s)
ans = 1
if s[0] != "A":
    ans *= 0
check = 0
for i in range(1, n):
    if s[i] == "C" and check == 0:
        check = 1
    elif s[i] == "C":
        check = 0
    else:
        if 97 <= ord(s[i]) <= 122:
            ans *= 1
        else:
            ans *= 0
if s[-1] == "C" or s[1] == "C":
    ans *= 0
print(["WA", "AC"][ans * check])
s=input()

if s[0]=="A":
  if s[2:-2].count("C")==1:
    if s.count("A")==1 and s.count("C")==1:
      print("AC")
    else:
      print("WA")
  else:
    print("WA")
else:
  print("WA")
S = input()
if S[0] == 'A':
    S = S[1:]
    if S[1:-1].count("C") == 1:
        S = S[1:-1].replace('C', 'c')
        if S.islower():
            print("AC")
            exit()
print('WA')
s=input()
if s[0]=="A" and s[2:-1].count("C")==1:
    print("AC")
else:
    print("WA")
s = list(input())
s1 = [i for i in s]
for j in range(len(s)):
    s1[j] = str.lower(s1[j])
s1[0] = "A"
s1[2] = "C"
if s == s1:
    print("AC")
else:
    print("WA")
s=list(input())
cnt=0
if s[0]!='A':
    print('WA')
    exit()
for i in range(2,len(s)-1):
    if s[i]=='C':
        cnt+=1
if 2<=cnt or cnt==0:
    print('WA')
    exit()
if 3<=s.count('[A-Z]'):
    print('WA')
else:
    print('AC')
s = list(input())
l = s[2:-2]
if s[0] == "A" and "C" in l:
    s.remove("A")
    s.remove("C")
    if str(s).islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")
S = input()
ans = "WA"
if S[0] == "A":
    tmp = S[2:len(S)-2]
    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()
N = len(S)
 
cond1 = True if S[0] == 'A' else False
cond2 = True if S[3:(N-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()
r = "WA"
n = len(S)
c = 0

for i in range(n):
  if i == 0 and S[i] == 'A':
    c += 1
  if S[i].islower():
    c += 1
  if 2 <= i <= n-1 and S[i] == 'C':
    c += 1

c = c + 1 - S.count('C')

if n == c:
  print('AC')
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]:
        if S[i] != S[i].upper():
            print('WA')
            exit()
        continue
    if S[i] != S[i].lower():
        print('WA')
        exit()
print('AC')
S = list(input())

if S[0] == 'A' and S[2:-2].count('C') == 1:
    S.pop(S[2:-2].index('C')+2)
    S.pop(0)
    if ''.join(S) == ''.join(S).lower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')
s=input()
ans='AC'
if s[0]!='A':
  ans='WA'
s=s[1:]
if s[1:-1].count('C')!=1:
  ans='WA'
s=s.replace('C','c')
for i in s:
  if i.islower==False:
    ans='WA'
    break
print(ans)
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","a")
        s=s.replace("C","b")
        if s.isupper()==False:
            print(s.isupper())
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")
s = input()
ans = 'WA'
if s[0] == 'A':
  s = s[1:]
  a = s[1:-2]
  if a.count('C') == 1:
    s = s.replace('C' , '' , 1)
    if s.islower():
      ans = 'AC'
print(ans)
s = list(input())

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

for i in range(len(s)):
    if s[i].islower():
        continue
    else:
        print("WA")
        exit()
print("AC")
def solve():
    s = list(input())
    if s[0] == "A" and s[2:-1].count("C") == 1:
        s.remove("A")
        s.remove("C")

        if "".join(s).islower:
            print("AC")
            exit()

    print("WA")


if __name__ == "__main__":
    solve()
s = input()
C = 0
if s[0] == 'A':
    for i in range(2, len(s)-1):
        if s[i] == 'C':
            C += 1
    if C == 1:
        print("AC")
    else:
        print("WA")
else:
    print("WA")
S = input()

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

print('WA')
import sys
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし

S = LS2()

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

ans = True if s[0] == 'A' else False
num = 0
for i in range(2, len(s) - 1):
    if s[i] == 'C':
        num += 1
    elif ord(s[i]) <= ord('Z') and ord(s[i]) >= ord('A'):
        ans = False
        break

if num != 1:
    ans = False

print('AC' if ans else '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 (''.join(s)).islower() == 0:
          print('AC')
     else:
          print('WA')
else:
     print('WA')
S = list(input())
c = 0
flag = 0
if S[0] == "A":
    for i in range(len(S)-3):
        if S[2+i] == "C":
            c += 1
            this = 2+i
    if c == 1:
        S.pop(this)
        S.pop(0)

    for i in S:
        if ord(i) < 97:
            break
        else:
            flag = 1

if flag == 1:
    print("AC")
else:
    print("WA")
S = input()
ans = 'WA'
if S[0] == 'A':
    if S[2 : -1].count('C') == 1:
        if S[0].replace('A', 'a') + S[2 : -1].replace('C', 'c') + S[-1] == S.lower():
            ans = 'AC'
print(ans)
S = input()
OK = False
if S[0] == 'A' and S[2] == 'C':
    if S[1].islower() and S[3:].islower():
        OK = True
# print(S[3:], S[3:].islower())
if S[0] == 'A' and S[-2] == 'C':
    if S[1:-2].islower() and S[-1].islower():
        OK = True

if OK:
    print('AC')
else:
    print('WA')
s = input()
s_len = len(s)
if s[0] == "A":
    if s[2:s_len-1].count("C") == 1:
        dum = s.index("C")
        s = s[1:dum]+s[dum+1:s_len]
        if s == s.lower():
            print("AC")
    else:
        print("WA")
else:
    print("WA")
S=input()
cnt=0
if S[0]!='A':
    print('WA')
else:
    for a in S[2:-1]:
        if a=='C':
            cnt+=1
    if cnt==1:print('AC')
    else:print('WA')
S = input()

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

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


def main():
    S = input()

    if (S[0] == 'A' and
            S[2:-1].count('C') == 1 and
            [s.islower() for s in S if s not in ['A', 'C']]):
        print('AC')
    else:
        print('WA')


if __name__ == "__main__":
    main()
s=input()
flag=0
if s[0]=="A":
    ss=s[2:-1]
    if ss.count("C")==1:
        for i,j in enumerate(ss):
            if j=="C":
                ss=ss.replace("C","c",1)
                if ss.islower() and s[1].islower():
                    print("AC")
                    flag=1
if flag==0:
    print("WA")
word=input()
cflg=True
if word[0]!='A':
  cflg=False
elif word[2:-2].count('C')!=1:
  cflg=False
cnt=0
for l in word[1:-1]:
  if l.isupper():
    cnt+=1
else:
  if cnt!=1:
    cflg=False
  
if cflg:
  print('AC')
else:
  print('WC')
S = str(input())

if S[0] == "A":
    S1 = "a"+S[1:]
    if S[2] == "C":
        S2 = S1[:2]+"c"+S1[3:]
        if S2.islower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")
S=input();n=len(S)
print('AC'if(S[0]=='A'and S[2:-2].count('C')==1 and len([i for i in range(n)if 96<ord(S[i])])==n-2)else'WA')
S = list(input())

if S[0] != 'A':
    print('WC')
elif 'C' not in S[2:-1]:
    print('WC')
else:
    S.remove('A')
    S.remove('C')
    S = ''.join(S)
    if S.islower():
        print('AC')
    else:
        print('WC')
s = list(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.pop(0)
  s.pop(1)
  for i in s:
    if i != i.lower():
      print("WA")
      exit()
elif s[0] == "A" and s[-1] == "C":
  s.pop(0)
  s.pop(-1)
  for i in s:
    if i != i.lower():
      print("WA")
      exit()
      
print("AC")
s = input()
if s[0] == 'A' and s[2:-2].count('C') == 1:
    Ci = s.index('C')
    if (s[1:Ci] + s[Ci + 1:]).islower:
        print('AC')
else:
    print('WA')
S = list(input())
c = 0
flag = 0
if S[0] == "A":
    for i in range(len(S)-3):
        if S[2+i] == "C":
            c += 1
            this = 2+i
    if c == 1:
        S.pop(this)
        S.pop(0)

        for i in S:
            if ord(i) < 97:
                break
            else:
                flag = 1

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

if s[0] == "A":
    
    if s[2:-1].count("C") == 1:
    
        if s[2:-1].replace("C","").islower():
            print("AC")
            exit()
print("WA")
s=input()
ans = True
count = 0
for i in range(len(s)):
  if s[i].isupper():
    count+=1
if count != 2:
  print('Wa')
  exit()
elif s[2:-1].count('C') != 1 or s[0]!='A' or not s[1].islower():
  print('Wa')
else:
  print('AC')
S = str(input())
s = list(S)
u = s
p = 0
for i in range(2,len(s)-1):
        if s[i] == 'C':
            p = p + 1
for i in range(2,len(s)-1-p):
    if s[i] == 'C':
        del s[i]
if s[0] == 'A':
    del s[0]
    if p == 1:
        q = ''.join(s)
        if q.islower() == True:
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')
s = input()

ans = True if s[0] == 'A' else False
num = 0
for i in range(2, len(s)):
    if s[i] == 'C' and i != len(s) - 1:
        num += 1
    elif ord(s[i]) <= ord('Z') and ord(s[i]) >= ord('A'):
        ans = False
        break

if num != 1:
    ans = False

print('AC' if ans else 'WA')
# 

l = list(input())
#print(l)
m = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
#print(m)

a = 0
for i in range(2,len(l)-1):
    if l[i] == 'C':
        a += 1
if a == 1 and l[0] == 'A':
    print('AC')
else:
    print('WA')
s = input()

if s[0] == "A":
    print("ok")
    if s[2:-1].count("C") == 1:
        print("ok")
        if s[2:-1].replace("C","").islower():
            print("AC")
            exit()
print("WA")
import re
print("AC" if re.match("^A[a-z]+C[a-z]+",input()) else "WA")
#!/usr/bin/env python3
S = input()
if S[0] == "A":
    ans2 = "AC"
else:
    ans2 = "WA"
list = list(S)

del list[1]
del list[0]
del list[-1]
ans1 = "WA"
if list.count("C") == 1:
    ans1 = "AC"
else:
    ans1 = "WA"

if ans1 == "AC" and ans2 == "AC":
    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)-1):
                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 AcCepted(s):

    ans = "WA"

    if s[0] == "A" and s[2:-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()
#!/usr/bin/env python3
s=input()
if s[0] == 'A' and 1 < s.find('C') < len(s) - 2 and (s[1:s.index('C')]+s[s.index('C')+1:]).islower():
    print("AC")
else:
    print('WA')
s = input()

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

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

s = s.lstrip("A")

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

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

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

if s.islower():
    print("AC")
else:
    print("WA")
s = input()
ans = "WA"

if s[0] == "A" and s[2:-2].count("C") == 1:
  tmp = s[1:]
  tmp.replace("C","")
  ans = "AC" if tmp.islower() else "WA"
  
print(ans)
s = input()
res = "AC"
for i in s:
    if (i!="A" and i!="C" and i.isupper() == True):
        res = "WA"
        break;
        
if (res == "AC" and s[0]=="A" and s.count("C")==1 and s.count("a") ==0 and s.count("c") == 0 and s.index("C")>1 and s.index("C")<len(s)-1 ):
    print("AC")
else:
    print("WA")
s = input()

if s[0]=='A' and s.count('C',2,-2)==1:
    #print(s[1:2]+s[2:-2].replace('C','')+s[-2:])
    if (s[1:2]+s[2:-2].replace('C','')+s[-2:]).islower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')
S = input()
if S[0] != 'A':
    print('WA')
    exit()
if S[2:-2].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')
s = input().rstrip()

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

f = False
for i in range(1, len(s)):
    if s[i] == 'C':
        if i < 2 or i >= len(s) - 2:
            print('WA')
            exit(0)
        if f:
            print('WA')
            exit(0)
        f = True
    elif not str.islower(s[i]):
        print('WA')
        exit(0)

if f:
    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 ])
print(first, second, third)
if first and second and third == 2:
    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 s[2:-1]:
                if i!='C' and i.isupper():
                    return 'WA'
            if s[1].isupper() and s[-1].isupper():
                return 'WA'
            return 'AC'
        else:
            return 'WA'
    print(main())
resolve()
s = input()
if s[0]=="A" and s[2:-2].count("C")==1:
    l = []
    for si in s:
        if si=="C" or si=="A":
            pass
        else:
            l.append(si.islower())
    if all(l):
        print("AC")
    else:
        print("WA")
else:
    print("WA")
s = input()
flag = 1
if s[0] == "A":
    tmp = s[2:-2].find("C")
    if tmp >= 0:
        tmp2 = s[1]
        tmp2 += s[2:tmp+2]
        tmp2 += s[tmp+3:]
        if tmp2 == tmp2.lower():
            flag = 0
if flag == 0:
    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] and s[0]=="A":
        s=s.replace("A","")
        s=s.replace("C","")
        if s.isupper()==False:
            print(s.isupper())
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")
S = input()

cap = S[0]
mid = list(S[2:-1])
print(mid)

if (mid.count('C') >= 1):
    index = S.index('C')
    strr = S[1:index] + S[index + 1 :]
else:
    print('WA')
    exit()


if (cap == 'A' and mid.count('C') == 1 and strr.islower() == True):
    print('AC')
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
    else:
        if 97 <= ord(s[i]) <= 122:
            ans *= 1
        else:
            ans *= 0
print(["WA", "AC"][ans * check])
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=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')