peterverebics/CodeNet_Python_118 huggingface dataset:
s = input()
if s[0] != 'A': print('WA')
else:
    c_cnt = 0
    end_p = len(s)-2
    for i in range(1,len(s)):
        
        # C判定
        if 2 <= i <= end_p and s[i] == 'C':
            c_cnt += 1
        
        # 小文字かどうか
        elif s[i] != s[i].lower():
            print('WA')
            exit()

    if c_cnt != 1:
        print('WA')
    else:
        print('AC')
s = input()
count_c = 0

if s[0] == 'A':
  if s[2:-1].count('C') == 1:
    for i in range(1, len(s)):
      if 97 <= ord(s[i]) <= 122:
        continue
      else:
        count_c += 1
      if count_c > 1:
        print("WA")
  else:
    print("WA")
else:
  print("WA")

if count_c == 1:
  print("AC")
import math

s=input()
x=s.find("C")

ok=True

for i in range(len(s)):
    if i==0 or i==x:
        continue

    if not s[i].islower():
        ok=False




if(s[0]=='A' and 2<=x<=len(s)-2 and ok):
    print("AC")
else:
    print("WA")
s = input()

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

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

s = (s.replace('A','')).replace('C','')

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

if S[0]!="A":
  print("WA")
else:
  cnt_C=0
  for i in range(2,len(S)-1):
    if S[i]=="C":
      cnt_C+=1
      
  if cnt_C!=1:
    print("WA")
  else:
    cnt_upper=0
    for i in range(len(S)):
      if S[i].isupper():
        cnt_upper+=1
        
    if cnt_upper!=2:
      print("WA")
    else:
      print("AC")
s=input()
boo=True
if s[0]!='A':
    boo=False
C=0
for i in range(2,len(s)-1):
    if s[i]=='C':
        C+=1
if C>1 or C<1:
    boo=False
l=0
for i in range(len(s)):
    if s[i].lower()!=s[i]:
        l+=1
if l>2 or l<2:
    boo=False
if boo:
    print("AC")
else:
    print("WA")
s=input()
flag=True
count=0

if(s[0]!='A'):
    flag=False

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

for i in s:
    if(i.islower()==False and i!='A' and i!='C'):
        flag=False

if(flag==True):
    print("AC")
else:
    print("WA")
from collections import Counter
l=input()
s=list(l)
k=0
if s[0]=='A':
    for i in range(2,len(s)-1):
        if s[i]=='C':
            k+=1
    if k==1:
        if l.replace('A', 'a').replace('C', 'c') == l.lower():print('AC')
        else:print('WA')
    else:print('WA')
else:print('WA')
S=input()

if S[0]=="A" and S[2:-1].count("C")==1:
	SC = S.index("C")
	if (S[1:SC]+S[SC+1:]).islower():
		print("AC")
	else:
		print("WA")
else:
	print("WA")
s = input()
flag = 1
if s[0] == "A":
    tmp = s[2:-1].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()
cnt = S[2:-1].count('C')
 
for s in S[1:]:
    if s.isupper() and s != 'C':
        print('WA')
        break
else:
    if S[0] == 'A' and cnt == 1:
        print('AC')
    else:
        print('WA')
s=input()
if s[0] != 'A':
    print('WA')
    exit()
if s[2:len(s)-1].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 = list(input())
if s[0] != 'A':
    print('WA')
elif s[2:-1].count('C') != 1:
    print('WA')
else:
    i = s.index('C')
    s.pop(i)
    s.pop(0)
    s = ''.join(s)
    if s.islower():
        print('AC')
    else:
        print('WA')
import sys

s = sys.stdin.readline().rstrip()

def main():
    if s[0] == 'A':
        if 'C' in s[2:-1]:
            cnt = 0
            for letter in s:
                if 65 <= ord(letter) <= 90:
                    cnt += 1
            if cnt == 2:
                return 'AC'
    return 'WA'

if __name__ == '__main__':
    ans = main()
    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
for i in range(2, len(S)-1):
    if S[0] == 'A' and S[i] == 'C':
        if S[1:i].islower() and S[i+1:].islower():
            OK = True
if OK:
    print('AC')
else:
    print('WA')
s = input()

# 大文字チェック
count = 0
for c in s:
    if c.isupper():
        count += 1

if count != 2:
    print("WA")
    exit()

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

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

print("AC")
S = input()
if S[0] == 'A':
  if S[2:-1].count('C') == 1:
    S1 = S.replace('A', '')
    S2 = S1.replace('C', '')
    if all([x.islower() for x in S2]):
        print('AC')
        exit()
print('WA')
import sys
s = list(input())
if s[0] != "A":
    print("WA")
    sys.exit()
c = 0
for i in range(2,len(s)-1):
    if s[i] == "C":
        c += 1
if c != 1:
    print("WA")
    sys.exit()
c = 0
for i in range(len(s)):
    if ord(s[i]) >= 65 and ord(s[i]) <= 90:
        c += 1
if c == 2:
    print("AC")
else:
    print("WA")
s = list(input())
ans = "AC"

if s[0] == "A" and "C" in s[2:-1] and s.count("C") == 1 and s[1].islower():
    for i in range(3, len(s)):
        if not s[i].islower() and s[i] != "C":
            ans = "WA"
            break
else:
    ans = "WA"

print(ans)
s = input()
ls = len(s)

sc = s[2:-1]
big = 0

import collections
c = collections.Counter(sc)


if s[0]=="A":
    if c["C"]==1:
        for i in range(ls):
            if s[i].isupper():
                big +=1
        if big ==2:
            print("AC")
            exit()

print("WA")
def main():
    s = input()

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

    s = s[1:]
    s = s.replace('C','')

    if not s.islower():
        print('WA')
        exit()  

    print('AC')

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

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

if s[0] == 'A' and s[2:-1].count('C') == 1 and t.islower():
    print('AC')
else:
    print('WA')
import re
ans=re.match("A[a-z]+C[a-z]+$",input())
print("AC" if ans else "WA")
s = list(input())
ans = 1
sw = 0
for i in range(len(s)):
    if i == 0 :
        if s[0] !="A":
            ans = 0
    elif 2 <= i <= len(s)-2 and s[i] == "C":
        sw += 1
    else:
        if not(97<= ord(s[i]) <= 122):
            ans = 0
if ans == 1 and sw == 1:
    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:-1] and c_cnt == 1:
    print('AC')
  else:
    print('WA')
else:
  print('WA')
S = input()

jdg = True
cnt = 0

for i, s in enumerate(S):
    if i == 0 and s != 'A':
        jdg = False
        break
    if (i == 1 or i == len(S) - 1) and not s in 'abcdefghijklmnopqrstuvwxyz':
        jdg = False
        break
    if 2 <= i <= len(S) - 2 and s == 'C':
        cnt += 1
    if i >= 1 and not s in 'abcdefghijklmnopqrstuvwxyzC':
        jdg = False
        break
if cnt != 1: jdg = False
            
print('AC' if jdg else 'WA')
s = input()
flag = True
if s[0] != 'A':
    flag = False

cnt_second = 0
second = s[2:-1]
for x in second:
    if x == 'C':
        cnt_second += 1

if cnt_second != 1:
    flag = False

cnt_third = 0
for x in s:
    if x.isupper():
        cnt_third += 1

if cnt_third != 2:
    flag = False

print('AC' if flag == True else 'WA')
S = list(input().strip())
flag = False

if S[0] == "A" and "C" in S[2:-1]:
    count = 0
    for s in S:
        #if s < "a":
        if "A" <= s <= "Z":
            count += 1
    if count == 2:
        flag = True
if flag:
    print("AC")
else:
    print("WA")
S = input()

# S = 'AaCa'
# print( S[1], S[-1], S[3:-2])

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

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

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

print( "AC" if b else "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

for i in s[1:]:
    if i != "C" and i.isupper():
        flag = 0

if num_C != 1:
    flag = 0


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

S = list(input().rstrip('\n'))
# print(S[2:-1])
if S[0] == 'A' and S[2:-1].count('C') == 1:
    S.remove('A')
    S.remove('C')
    S = ''.join(S)
    # print(S)
    if S.islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")
import sys
S = input()
cnt = 1
tmp = 0
if S[0] == 'A':
    for i in range(2, len(S)-1):
        if S[i] == 'C':
            tmp = i
            cnt -= 1
if cnt == 0:
    for i in range(len(S)):
        if S[i].isupper() is True and i != 0 and i != tmp:
            print('WA')
            sys.exit()
    print('AC')
else:
    print('WA')
s = input()

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

if S[0]!='A':
  print('WA')
  exit()
else:
  S_withoutA = S.replace('A','')

S_part = [i for i in S[2:-1] if i=='C']
if len(S_part) != 1:
  print('WA')
  exit()
else:
  S_withoutAC = S_withoutA.replace('C','')

if S_withoutAC.islower():
  print('AC')
else:
  print('WA')
def sol():
    S = input()

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

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

    for s in S[2:-1]:
        if s != 'C' and s.isupper():
            print('WA')
            return

    if S[1].isupper() or S[-1].isupper():
        print('WA')
        return

    print('AC')

sol()
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')
else:
    print("WA")
def main():
    s = input()
    if s[0] == "A" and s.count("C", 2, -1)==1:
        s = s.replace("A", "")
        s = s.replace("C", "")
        if s.islower() == True:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
    
if __name__ == '__main__':
    main()
#!/usr/bin/env python3
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
s = input()
if s[0] != "A": print("WA")
elif s[2:-1].count("C") != 1: print("WA")
else:
    for i in range(len(s)):
        if s[i] in "AC": pass
        elif 97 <= ord(s[i]) <= 122: pass
        else:
            print("WA")
            exit(0)
    print("AC")
S = input()
flag = True
count = 0
if not S[0] == "A":
  flag = False
for i in range(2,len(S)-1):
  if S[i] == "C":
    count += 1
  else:
    if not S[i].islower():
      flag = False
if not S[1].islower():
  flag = False
if not S[len(S)-1].islower():
  flag = False
if not count == 1:
  flag = False
if flag:
  print("AC")
else:
  print("WA")
s=input()

if (s[0]=="A" and s[2:-1].count("C")==1):
  pos=s.index("C")
  check=s[1:pos]+s[pos+1::]
  if (check.islower()):
    print("AC")
  else:
    print("WA")
else:
  print("WA")
S = input()
answer = 'WA'
if S[0] == 'A':
    sKiridashi = S[2:-1]
    if sKiridashi.count('C') == 1:
        cIndex = sKiridashi.find('C') + 2
        otherStr = S[1:cIndex] + S[cIndex+1:]
        if otherStr.islower():
            answer = 'AC'
print(answer)
S = list(input())
c = S[2:-1].count('C')
u = 0
for char in S:
  if char.isupper():
    u += 1

if S[0]=='A' and c == 1 and u == 2:
  print('AC')
else:
  print('WA')
S = input()

if S[0] != 'A':
    print('WA')
    exit()
    
index = S[2:-1].find('C')
if index == -1:
    print('WA')
    exit()
index = S[2:-1].find('C',index+1)
if index >= 0:
    print('WA')
    exit()


index = S.find('C')
S=S[1:index] + S[index + 1:len(S)]

if S != S.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")
    
    if "".join(s).lower() == "".join(s):
        print("AC")
    else:
        print("WA")

else:
    print("WA")
S = input()
Ssl = S[2:-1]
Srp = S.replace("A", "")
Srp = Srp.replace("C", "")
cnt = Ssl.count("C")
if S[0] == "A" and cnt == 1 and Srp.islower():
    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 s in S:
    if s != 'A' and s != 'C' and s.isupper():
        f = False
print('AC' if f else 'WA')
S = input()


ans = 0
num = 0
cnum = 0

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

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

for j in range(len(S)):
  if S[j].islower() == True:
    num += 1

    
if num == len(S)-2:
  ans +=1
  
  
  

if ans ==3:
  print("AC")
else:
  print("WA")
s = input()
ans = 'AC'
if s[0] != 'A':
    print('WA')
    exit()
else:
    s = s[1:]
if 'C' not in s[1:-1]:
    print('WA')
    exit()
else:
    if s.count('C') != 1:
        print('WA')
        exit()
    else:
        ss = s.replace('C','')
        if ss.islower():
            print('AC')
        else:
            print('WA')
s = input()

if s[0] == "A" and s[2:-1].count("C") == 1:
  idx = s.index("C")
  if s[1:idx] == s[1:idx].lower() and s[idx+1:] == s[idx+1:].lower():
    print("AC")
  else:
    print("WA")
else:
  print("WA")
s = input()

ans = 'AC'

if s[0] != "A":
    ans = "WA"
count = 0

for i in range(1,len(s)):
    if s[i].isupper():
        if i == 1 or i == len(s)-1 or s[i] != "C":
            ans = "WA"
        count += 1

if count != 1:
    ans = "WA"

print(ans)
s = input()
count = 0
for i in range(0, len(s)):
    if i == 0 and s[i] == 'A': continue
    if i == 1 and 97 <= ord(s[i]) <= 122: continue
    if 2 <= i <= len(s) - 2:
        if s[i] == 'C':
            count += 1
            continue
        elif 97 <= ord(s[i]) <= 122: continue
    if count == 0 or count >= 2: break
    if i == len(s) - 1 and 97 <= ord(s[i]) <= 122:
        print("AC")
        exit()
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[1:]):
  print('AC')
else:
  print('WA')
import sys
input = sys.stdin.readline


def main():
    S = input().rstrip()

    ans = "AC"
    if not S[0] == "A":
        ans = "WA"
    if not S[2:-1].count("C") == 1:
        ans = "WA"
    else:
        count = 0
        for s in S:
            if s.isupper():
                count += 1
        if count != 2:
            ans = "WA"
    print(ans)


if __name__ == "__main__":
    main()
s = input()
if s[0] != 'A':
    print('WA')
    exit()

if s.count('C', 2, -1) != 1:
    print('WA')
    exit()

s2 = s[1:].replace('C', '')
if not s2.islower():
    print('WA')
    exit()

print('AC')
s = input()
if s[0]=="A" and s[2:-1].count("C") == 1 and s[1:].replace("C", "").islower():
    print("AC")
else:
    print("WA")
s = input()
if s[0] !='A':
    print('WA')
    exit()
if 'C' not in s[2:len(s)-1]:
    print('WA')
    exit()
cnt = 0
for i in s:
    if i.isupper():
        cnt +=1
if cnt !=2:
    print('WA')
    exit()
print('AC')
s=input()
p=len(s)
fir=s[0]=="A"
sec=s.count("C",2,-1)
thi=sum(map(lambda x:x.islower(), s))==p-2
if fir and sec and thi:
    print("AC")
else:
    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')
    exit()
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 = 'AC'

if S[0] != 'A':
  ans = 'WA'

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

S = S.replace('A', 'a').replace('C', 'c')

if S.islower() == False:
  ans = 'WA'
  
print(ans)
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("WA")
      exit()
  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("a"):
                break
        else:
            ans="AC"
print(ans)
#104
s=input()
if s[0]!="A":
    print("WA")
elif "C" not in s[2:-1] or s[2:-1].count("C")!=1:
    print("WA")
elif s[1]==str.upper(s[1]):
    print("WA")
elif (s[1:2]+s[-1]).strip("C")==str.lower((s[1:2]+s[-1]).strip("C")):
    print("AC")
else:
    print("WA")
S=input()
print('WAAC'[S[0]=='A' and S.count('C',2,-1)==1 and len(list(filter(lambda x: x.isupper(),list(S))))==2::2])
S = input()
if S[0] == 'A' and S[2:-1].count('C') == 1:
    S = S[1] + S[2:-1].replace('C', '') + S[-1]
    if S == S.lower():
        print('AC')
        exit()
print('WA')
s = input()
ans = 'WA'
a = []
if s[0] == 'A' and s[2:-1].count('C') == 1:
     a = list(s)
     a.remove('A')
     a.remove('C')
     a = str(a)
     if a.islower() == True:
          ans = 'AC'
print(ans)
S = input()
if S[0] == 'A' and S[2:-1].count('C') == 1:
    chk = S.replace('A', '').replace('C', '')
    l = len(chk)
    cnt = 0
    for s in chk:
        if s.islower():
            cnt += 1
    if cnt == l:
        print('AC')
        exit()
print('WA')
S = input()

if S[0] == "A":
    if S[2:-1].count("C") == 1:
        idx = S[2:-1].index("C") + 2
        S = S[1:idx] + S[idx+1:]
        if S == S.lower():
            print("AC")
            exit()

print("WA")
S = input()
if S[0] != "A":
    print("WA")
    exit()
if S[2:-1].count("C") != 1:
    print("WA")
    exit()
if (S[1:S.index("C",2)] + S[S.index("C",2)+1:]).islower():
    print("AC")
else:
    print("WA")
S=str(input())
cnt=0
for i in range(2,len(S)-1):
    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()
if S.startswith("A") and S[2:-1].count("C") == 1 and S[1:].replace("C","c").islower():
    print("AC")
else:
    print("WA")
S = input()
if S[0] == 'A' and S[2:-1].count('C') == 1:
    S_ = S.replace('A', '').replace('C', '')
    if S_.islower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')
S = str(input())

if S[0] == "A":
    next = S[2:-1]

    if next.count("C") == 1:
        next = list(S[1:])
        next.remove("C")
        next = str(next)

        if next.islower():
            print("AC")
            exit()

print("WA")
s=input();print('WAAC'['A'==s[0] and s[2:-1].count('C')==1 and s.replace('A','').replace('C','').islower()::2])
s = input()

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

if S[0]=="A":
  S = S[1:]
  if 1<=S.find("C")<=len(S)-2:
    S = S[:S.find("C")]+S[S.find("C")+1:]
    for s in S:
      if 97<=ord(s)<=122:
        ans+=1
    if ans == len(S):
      print("AC")
      exit()
        
print("WA")
s = input()
flag = True
flag = flag and s[0] == 'A'
Ccount = 0
for i in range(1,len(s)):
  if ord('a') <= ord(s[i]) and ord(s[i]) <= ord('z'): continue
  if s[i] == 'C' and 2 <= i and i <= len(s)-2:
    Ccount += 1
  else:
    flag = False
print("AC" if flag and Ccount == 1 else "WA")
s = input()

ok = True
ok = ok and s[0] == 'A'

cs = 0
for i in range(2, len(s)-1):
    if s[i] == 'C':
        cs += 1

ok = ok and cs == 1

for i in range(1, len(s)):
    if s[i].islower():
        continue
    if s[i] == 'C':
        continue
    ok = False

print('AC' if ok else 'WA')
if __name__ == '__main__':

	s = input()
	flg = False
	
	if s[0] == "A":
		tmp = s[2:-1]
		if tmp.count("C") == 1:
			tmp2 = s.replace("A","")
			tmp2 = tmp2.replace("C","")
			if tmp2.islower() == True:
				flg = True

	if flg == True:print("AC")
	else:		print("WA")
import sys
s = str(input())

if s[0] != 'A':
    print('WA')
    sys.exit()
    
test_st = s[2:-1]
#print(test_st)
test_stx =''
for i in range(len(test_st)):
    if test_st[i] == 'C':
        test_stx = s[1]+test_st[:i] + test_st[i+1:]+s[-1]
        #print(test_stx)
    
if test_stx.islower() and len(test_stx) >0:
    print('AC')
else:
    print('WA')
import sys
S = input()
if S[0] != "A":
  print("WA")
  sys.exit()

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

Cindex = S.find("C")
if Cindex < 2 or Cindex > len(S)-2:
  print("WA")
  sys.exit()
  
T = 'a' + S[1:]
T = T[0:Cindex] + "c" + T[Cindex+1:]

if T.islower():
  print("AC")
else:
  print("WA")
s=input()
cnt_1=0
cnt_2=0
for i in range(1,len(s)):
  if i!=1 and i!=len(s)-1 and s[i]=="C":
    cnt_2+=1
  if s[i].islower():
    cnt_1+=1
if s[0]=="A" and cnt_2==1 and cnt_1==len(s)-2:
  print("AC")
else:
  print("WA")
import re
print("AC" if re.match("^A[a-z]+C[a-z]+$",input()) else "WA")
s=input()
#print(s[1]+s[2:2+s[2:-1].index("C")]+s[s[2:-1].index("C")+1:])
if s[0]=="A" and s[2:-1].count("C")==1:
    if (s[1]+s[2:2+s[2:-1].index("C")]+s[s[2:-1].index("C")+3:]).islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")
import sys
from collections import deque
def input(): return sys.stdin.readline().strip()


def main():
    S = input()
    if S[0] != 'A' or ord('A') <= ord(S[1]) <= ord('Z') or ord('A') <= ord(S[-1]) <= ord('Z'):
        print("WA")
        return
    capital = []
    for i in range(2, len(S) - 1):
        if ord('a') <= ord(S[i]) <= ord('z'): continue
        capital.append(S[i])
    
    if capital == ['C']:
        print("AC")
    else:
        print("WA") 


if __name__ == "__main__":
    main()
s = input()
n = len(s)
alp = [chr(ord('a')+i)for i in range(26)]
a = s[0] == 'A'
b = s.count('C') == 1 and s.index('C') >=2 and s.index('C')<= n-2
c = True
for i in range(n):
    if i == 0:continue
    if s[i] == 'C':continue
    if s[i] not in alp:
        c = False
ok = a and b and c
if ok:print('AC')
else:print('WA')
s=input()
if s[0]=="A" and s[2:-1].count("C")==1:
  c=s[2:-1].index("C")
  if s[1:c+2].islower() and s[c+3:].islower():
    print("AC")
  else:
    print("WA")
else:
  print("WA")
s=input()
flag = "AC"
if s[0] != "A":
    flag = "WA"
else:
    if not "C" in s[2:-1]:
        flag = "WA"
    else:
        ls = [c for c in s]
        ls.remove("A")
        ls.remove("C")
        if not "".join(ls).islower():
            flag = "WA"
        #for c in ls:
            #if c.isupper():
                #flag = "WA"
print(flag)
s = input()

if s[0] == 'A' and s[2:-1].count('C') == 1:
    t = s[1:].replace('C', '')
    ans = 'AC' if t.lower() == t else 'WA'
else:
    ans = 'WA'

print(ans)
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:-1].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')
S = input()

def stringChecker(S):
    if S[0] != 'A':
        return False
    cnt = 0
    for l in S[2:-1]:
        if l == 'C':
            cnt += 1
    if cnt != 1:
        return False
    
    lower_cnt = 0
    for l in S:
        if l.islower():
            lower_cnt += 1
    if lower_cnt != len(S) - 2:
        return False
    
    return True
if stringChecker(S):
    print('AC')
else :
    print('WA')