peterverebics/CodeNet_Python_118 huggingface dataset:
s=input()
s_len=len(s)
ans="WA"
t=""
if s[0]!="A":
    print(ans)
else:
    t+=s[0].lower()
    t+=s[1]
    count=0
    for i in range(2,s_len-1):
        if s[i]=="C":
            count+=1
            t+=s[i].lower()
        else:
            t+=s[i]
    t+=s[s_len-1]
    if count!=1 or t!=s.lower():
        print(ans)
    else:
        print("AC")
S = list(input())
ans = 'AC'
if not S[0] == 'A':
    ans = 'WA'
if not 'C' in (S[2:-1]):
    ans = 'WA'
if ans == 'AC':
    S.remove('A')
    S.remove('C')
    if not S == [s.lower() for s in S]:
        ans = ('WA')
print(ans)
s=input()
if s[0]=="A" and s[2:len(s)-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 and s.replace("A","").replace("C","").islower():
    print("AC")
else:
    print("WA")
#ABC104

s = input()

if s[0] == "A" and s[2:-1].count("C") == 1:
    k = s[2:-1].index("C") + 2
    
    if str.islower(s[1:k] + s[k+1:]):
        print("AC")
    else:
        print("WA")
else:
    
    print("WA")
S = list(input())
C = S[2:-1]
if S[0] == "A" and "C" in C and C.count("C") == 1:
    S.remove("A")
    S.remove("C")
    T="".join(S)
    Y=T.lower()
    if T == Y:
        print("AC")
    else:
        print("WA")
else:
    print("WA")
import re

S = input()

if('A' in S[0]):
    if('C' in S[2:-1]):
        if(len(re.findall('[A-Z]',S)) == 2):
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')
S = input()

flag = True
c_count = 0
for i in range(0, len(S)):
  if i == 0:
    if S[i] != "A":
      flag = False
      break
  elif i >= 2 and i <= (len(S) - 2):
    if S[i] == "C":
      c_count += 1

  if ord("A") <= ord(S[i]) and ord(S[i]) <= ord("Z"):
    if ord("A") != ord(S[i]) and ord("C") != ord(S[i]):
      flag = False
      break

if flag and c_count == 1:
  print("AC")
else:
  print("WA")
word=input()
cflg=True
if word[0]!='A':
  cflg=False
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('WA')
s = input()
if s[0] != 'A':
    print('WA')
elif s[2:-1:].count('C') != 1:
    print('WA')
else:
    l = list(s[1::])
    l.remove('C')
    st = ''.join(l)
    if st == st.lower():
        print('AC')
    else:
        print('WA')
s = input()

if s[0] == 'A' and s[2:-1].count('C') == 1:
    for i in s:
        if i.islower() == True:
            continue
        elif i == 'A' or i == 'C':
            continue
        else:
            print('WA')
            exit()
else:
    print('WA')
    exit()

print('AC')
import re

S = input()
if S[0] != "A" or len(re.findall("C", S[2:-1])) != 1:
    print("WA")
    exit()

if len(re.findall("[A-Z]", S)) != 2:
    print("WA")
else:
    print("AC")
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")
else:
    print("WA")
import sys


def main():
    s = list(input())
    if s[0] != 'A' or s[2:-1].count("C") != 1:
        print("WA")
    else:
        for i in range(1, len(s)):
            if ord(s[i]) < ord('a') and i != s.index('C'):
                print("WA")
                sys.exit(0)
        print("AC")


if __name__ == "__main__":
    main()
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 ss!='C' and ss.isupper():
        f=False
print('AC' if f else 'WA')
def main():
    s = input()
    len_s = len(s)
    
    if s[0] == "A" and \
       s[2:-1].count("C") == 1 and \
       sum(s[i].islower() for i in range(len_s)) == len_s - 2:
       print("AC")
    else:
       print("WA")


main()
s=input()

if s[0]!="A":
  ans="WA"
else:
  c_cnt=s.count("C",2,len(s)-1)
  cnt=s.count("C")
  if c_cnt!=1 or c_cnt!=cnt:
    ans="WA"
  else:
    s=s.replace("C","c")
    if s[1:].islower():
      ans="AC"
    else:
      ans="WA"
    
print(ans)
S = input()
rs = 'WA'
if S[0] == 'A' and S[2:-1].count('C')==1:
    S = S[1:2]+S[2:-1].replace('C', '')+S[-1:]
    if S.islower():
        rs = 'AC'
print(rs)
S = input()
ans = 0

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

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

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

if ans == 3:
    print('AC')
else:
    print('WA')
def solve():
    s = list(input())
    if (s[0] == "A") and (s[2:-1].count("C") == 1):
        s.remove("A")
        s.remove('C')
        if str(s).islower():
            print("AC")
        else:
            print('WA')
    else:
        print('WA')


if __name__ == "__main__":
    solve()
s = input()
ans = 1

if s[0] == "A":
    ans += 1
    
part = s[2:-1]
if part.count("C") == 1:
    ans += 1
      
for i in range(len(s)):
    if 65 < ord(s[i]) <91 and ord(s[i]) != 67:
        ans -= 1
        
print("AWCA"[ans<3::2])
S = input()
N = len(S)
out = "AC"
if S[0]!="A":
    out = "WA"
cnt = 0
for i in range(2,N-1):
    if S[i]=="C":
        cnt+=1
if cnt!=1:
    out = "WA"

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

for i in range(1,N-1):
    if S[i]!="C" and S[i] not in al:
        out = "WA"
if S[N-1] not in al:
    out = "WA"

print(out)
S = input()
 
if (S[0] == "A")and (S[2:len(S)-1].count("C") ==1):
    if S.replace("A","",1).replace("C","",1).islower() == True:
        print("AC")
    else:
        print("WA")
else:
  print("WA")
S = input()
ans = 'AC'
if S[0] != 'A':
    ans = 'WA'
cnt = 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'
        cnt+=1

if cnt != 1:
    ans = 'WA'
print(ans)
#!/usr/bin/env python3
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
s = input()
# flagで複数条件の管理をした方が頭がバグらない
flag = 1
if s[0] != "A": flag = 0

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

for i in range(len(s)):
    if s[i] in "AC": pass
    elif 97 <= ord(s[i]) <= 122: pass
    else: flag = 0
print("AC" if flag else "WA")
S=input()
if S[0]=="A" and S[2:-1].count("C")==1 and S[1].islower() and S[-1].islower():
    for s in S[2:]:
        if s!="C":
            if s.islower():
                print("AC")
                exit()
print("WA")
s = str(input())
num = 0

if s[0] == "A":
  if "C" in s[2:len(s)-1]:
    for i in s:
      if i.isupper():
        num += 1
    if num == 2:
      print("AC")
      exit(0)
      
print("WA")
S = input()

if S[0] == "A" and S.count("A") == 1 and S.count("C") == 1:
    p = S.find("C")
    b = S.replace("A","").replace("C","")
    if p > 1 and p < len(S) - 1 and b.islower():
        print("AC")
    else:
        print("WA")
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")
    exit()
s.sort()
for i in range(2, len(s)):
    if s[i].isupper():
        print("WA")
        exit()
print("AC")
S=input()
p='AC'
o=0
u=0
for i in range(len(S)):
  if i==0 and S[i]!='A':
    p='WA'
    break
  if 2<=i<=len(S)-2:
    if S[i]=='C':
      o+=1
  if len(S)-2<i and o!=1:
    p='WA'
    break
  if ord(S[i])<97:
    if i==0 or 2<=i<=len(S)-2:
      continue
    else:
      p='WA'
      break
print(p)
S = input()
N = len(S)

if S[0] == "A" and S[2:N-1].count("C") == 1 and sum(s.islower() for s in S) == N-2:
  print("AC")
else:
  print("WA")
s=input()
if s[1]==s[1].upper() or s[-1]==s[-1].upper():
    print("WA")
    exit()

if s[0]=="A":
    count=0
    for i in range(2,len(s)-1):
        if s[i]=="C":
            count+=1
        else:
            if s[i]==s[i].upper():
                print("WA")
                exit()
    if count==1:
        print("AC")
    else:
        print("WA")
else:
    print("WA")
s = input()
n = len(s)
if s[0] == "A" and s[2:n-1].count("C") == 1 and len(set(s.upper()) & set(s)) == 2:
    print("AC")
else:
    print("WA")
s = input()
S = s[1]+s[2:-1].replace("C","c")+s[-1]
if s[0]=="A" and s[2:-1].count("C")==1 and s[-1]!="C" and S.islower():
  print("AC")
else:
  print("WA")
s=input()
yn=0
if s[0]=="A" and ord(s[1])>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()
if s[0]=="A" and s[2:-1].count("C") == 1 and s[1:].replace("C","c").islower():
    print("AC")
    exit()

print("WA")
S = input()
if ord(S[0]) != 65:
  print('WA')
else:
  b = 0
  c = 0
  for i in range(1, len(S)):
    if i != 1 and i != len(S) - 1 and ord(S[i]) == 67:
      b += 1
    elif ord(S[i]) <= 96 or 123 <= ord(S[i]):
      c = 1
  if b == 1 and c == 0:
    print('AC')
  else:
    print('WA')
S = list(input())

if S[0] == 'A':
  isC = 0
  for i in S[2:len(S)-1]:
    if i == 'C':
      isC += 1
  else:
    if isC == 1:
      for i in range(len(S)):
        if S[i] == 'A' or S[i] =='C' or S[i].islower():
          pass
        else:
          print('WA')
          break
      else:
        print('AC')
    else:
      print('WA')
else:
  print('WA')
S = input()
cond1 = (S[0]=="A")
cond2 = (S[2:len(S)-1].count("C") == 1)


flag = True
if not cond1:
    flag = False
else:
    if not cond2:
        flag = False
    else:
        idx = S[2: len(S)-1].index("C") + 2
        new = S[1:idx] + S[idx+1:]
        if new != new.lower():
            flag = False

if flag:
    print("AC")
else:
    print("WA")
a = input()
print('AC' if a[0] == 'A' and 'C' in a[2:-1] and a[1:].replace('C', '', 1).islower() else 'WA')
s = input()
if s[0] != 'A':
    print('WA')
    exit()
if s[2:-1].count('C') != 1:
    print('WA')
    exit()
s = s[1:2] + s[2:-1].replace('C', '') + s[-1:]
if s.islower():
    print('AC')
else:
    print('WA')
def main():
    S = input()
    L, R = 2, len(S) - 2
    if S[0] != 'A':
        print('WA')
        exit()

    cnt = 0
    for i in range(1, len(S)):
        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()
ans = 'WA'
if s[0] == 'A':
  s = s[1:]
  a = s[1:-1]
  if a.count('C') == 1:
    s = s.replace('C' , '' , 1)
    if s.islower():
      ans = 'AC'
print(ans)
s = input()
ok = True

ok &= s[0] == 'A'
ok &= s[1].islower()
ok &= s[2:-1].count('C') == 1
ok &= all(c.islower() for c in s[2:-1] if c != 'C')
ok &= s[-1].islower()

print('AC' if ok else 'WA')
s = input()
if s[0]!="A":
    print("WA")
    exit()

ss = ""
count = 0
for i in range(2, len(s)-1):
    if s[i] == "C":
        count += 1
    else:
        ss += s[i]
sss = s[1]+ss+s[-1]
if count==1:
    if sss.islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")
    exit()
s = list(input())

if "C" in s[2:-2] and s[0]=="A":
    del s[s.index("C")]
    del s[0]
else:
    print("WA")
    exit()
    
for i in range(len(s)):
    if s[i].islower():
        continue
    else:
        print("WA")
        exit()
print("AC")
s = input()
count1 = 0
count2 = 0
count3 = 0
count4 = 0
if s[0] == 'A'and s[1].islower() == True:
    count1 += 1
for i in range(2, len(s) - 2):
    if (s[i] == 'C'):
        count2 += 1
for i in range(len(s) - 2, len(s)):
    if s[i].islower() == True:
        count3 += 1
if count1 != 1 or count2 != 1 or count3 != 2:
    print('WA')
else:
    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):
    print(i)
    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")
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:-1]

if sss.islower():
    print("AC")
    sys.exit()

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
    else:
        if i.isupper():
            flag = 0
if num_C != 1:
    flag = 0


if flag == 0:
    print("WA")
else:
    print("AC")
s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1 and s.count('C') == 1:
     list(s).remove("A")
     list(s).remove("C")
     if s.islower() == 0:
          print('AC')
          exit()
     else:
          print('WA')
else:
     print('WA')
S = list(input())
C = S[2:-1]
if S[0] == "A" and "C" in C and C.count("C") == 1:
    S.remove("A")
    S.remove("C")
    print(S)
    T="".join(S)
    print(T)
    Y=T.lower()
    if T == Y:
        print("AC")
    else:
        print("WA")
else:
    print("WA")
S = input()

ans = "WA"

if S[0] != "A":
  ans = "WA"
  print(ans)
else:
  if S[1:len(S) - 1].count("C") != 1:
    print(ans)
  else:
    s = S.index("C")
    SS = S[1:s] + S[s + 1:]
    if SS.islower() == False:
      print(ans)
    else:
      print("AC")
S = input()
if S[0] != "A":
  print("WA")
  exit()
elif S[2:-2].count("C") != 1 and S[:2].count("C") != 0 and S[-2:].count("C") != 0:
  print("WA")
  exit()
else:
  S = S[1:].replace("C", "")
  if S.islower():
    print("AC")
  else:
    print("WA")
s = input()
n = len(s)
res = []
ans = 0
for i in s:
      if i == 'A' or i == 'C':
        res.append(i)
if s[0] == 'A':
  ans += 1
if s.find('C') >= 2 and s.find('C') < n-2:
  ans += 1
if res == ['A', 'C']:
  ans += 1
if ans == 3:
  print('AC')
else:
  print('WA')
s = input()
if s[0]=="A" and s[2:-1].count("C")==1 and s[-1]!="C":
  print("AC")
else:
  print("WA")
def main():
    S = input()
    flag = True
    if S[0] == 'A':
        cnt = 0
        pos = -1
        for i in range(2, len(S)-1):
            if S[i] == 'C':
                cnt += 1
                pos = i
            elif S[i].isupper():
                flag = False
        if flag and cnt == 1:
            print("AC")
            return
    print("WA")
    
main()
s = list(input())
c = 0
if s[0] != 'A':
    print('WA')
else:
    s[0] = 'a'
    for i in range(2,len(s)-2):
        if s[i] == 'C':
            s[i] = 'c'
            c = 1
    news = ''.join(s)
    if news.islower() and c == 1:
        print('AC')
    else:
        print('WA')
s=input()
res="AC"
if s[0]!="A":res="WA"
elif s[2:-2].count("C")!=1:res="WA"
else:
    li=list(s)
    li.remove("A")
    li.remove("C")
    for i in li:
        if i!=i.lower():
            res="WA"
print(res)
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 = 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('No')
elif A_check[0] != '0' or C_check[0] == len(S) - 1 or C_check[0] < 2:
    print('No')
else:
    print('Yes')
s=input()
print('AC' if s[0]=='A' and s[2]=='C' and s[1].islower() and s[3:].islower() else 'WA')
# coding: utf-8
# Your code here!
import sys
s = str(input())

ch = s[0]+s[2]

test_st = s[1]+s[3:]
#print(test_st)
if ch == 'AC' and 'C' not in test_st:
    print('AC')
else:
    print('WA')
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():
    print("AC")
  else:
    print("WA")
else:
  print("WA")
s=input()
result=True
total=0
for i in range(len(s)):
    if i==0:
        if s[i]!="A":
            result=False
            break
    elif 2<=i<=len(s)-2:
        if s[i]=="C":
            total+=1
        if total!=1:
            result=False
            break
    else:
        if s[i].islower()==False:
            result=False
            break
if result==False:
    print("WA")
else:
    print("AC")
import re

S = input()
if('A' in S[0]):
    if('C' in S[2:-2]):
        if(len(re.findall('[A-Z]',S)) == 2):
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')
s = input()
cnt = 0
if s[0] != 'A':
    print('WA')
elif s[2:-1].count('C') != 1:
    print('WA')
elif s[1:3].islower() != True and s[-1].islower !=  True:
    print('WA')
else:
    print('AC')
import sys
S=input()
first=S[0]
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):
    print("AC")
  else:
    print("WA")
        
else:
  print("WA")
s = str(input())
isOK = True
if s[0]=='A':
    tmp = s[2:-1]
    cnt = 0
    for i in range(len(tmp)):
        if tmp[i]=='C':
            cnt += 1
    if cnt!=1:
        isOK = False
else:
    isOK = False

if isOK:
    print('AC')
else:
    print('WA')
s = list(input())
j= 0
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.isupper():
    print('WA')
    exit()

print('AC')
s = input()
if s[0] != 'A':
  print('WA')
  exit()
sho = ord('a')
ok = 0
for i in s[2: len(s) - 1]:
  if ord(i) < sho:
    if ord(i) == ord("C"):
      ok += 1
    else:
      print("WA")
      exit()
if ord(s[0]) < sho or ord(s[1]) < sho or ord(s[len(s) - 1]) < sho:
  print("WA")
  exit()
if ok == 1:
  print("AC")
else:
  print("WA")
S=input()
ans = "WA"
if S[0] == "A" and ("a" <= S[1] <= "z") and ("a" <= S[-1] <= "z"):
  s0 = S[2:-2]
  for i in range(len(s0)):
    if s0[i] == "C":
      if ans == "AC":
        ans = "NG"
      else:
        ans = "AC"

print(ans)
S = input()

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

print("AC")
s=input()
print("AC" if s[0]=="A" and s[2:-1].count("C")==1 and s[:-1].strip("A").strip("C").islower() else "WA")
s = input()
if s[0]=="A" and "C" in s[2:-2] and str(s[0]).isupper()== True and  str(s[1]).islower()==True and str(s[-2:]).islower() == True:
    a=s.index('C')
    if (s[2:a]+s[a+1:-2]).islower()== True:
        print('AC')
else:
    print('WA')
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)-3) and c == "C": continue
  if c.isupper(): judge = False
print("AC" if judge else "WA")
S = list(input())
ans = 'AC'
if not S[0] == 'A':
    ans = 'WA'
if not 'C' in (S[2:-2]):
    ans = 'WA'
if ans == 'AC':
    S.remove('A')
    S.remove('C')
    if not S == [s.lower() for s in S]:
        ans = ('WA')
print(ans)
s = input()
ans = "AC"
if s[0] != 'A':
    ans = "WA"
s = list(s)
s[0] = 'a'
f = 0
for i in range(2,len(s)-1):
    if s[i] == "C":
        if f:
            ans = "WA"
        else:
            f = 1
            s[i] = "c"

if not f:
    ans = "WA"
for si in s:
    if si not in "abcdefghijklmnopqrstuvwxyz":
        print(si, 1)
        ans = "WA"
print(ans)
s = list(input())
if (s[0] == "A") and (s[2:-2].count("C")==1):
    print("aa")
    s[0] = "a"
    s[s[2:-2].index("C")+2] = "c"
    l = list()
    for i in range(len(s)):
        l.append(s[i].lower())
    #(s,l)
    if s == l:
        print("AC")
        exit()
print("WA")
s = list(input())
s1 = [i for i in s]
s1[0] = "A"
s1[2] = "C"
for j in range(len(s)):
    if j != 0 or j != 2:
        s1[j] = str.lower(s1[j])
if s == s1:
    print("AC")
else:
    print("WA")
"""
1. The initial character of S is an uppercase A.
2. There is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).
3. All letters except the A and C mentioned above are lowercase.
"""
import collections
def a(r): return r[0] == 'A'
def b(r): return collections.Counter(r[1:-2])['C'] == 1
def c(r): return all([l in set(['A', 'C']) or l.lower() ==l for l in r ])
def f(r):  return a(r) and b(r) and c(r)

print 'AC' if f(raw_input()) else 'WA'
s=input()
print("AC" if s[0]=="A" and s[2:-1].count("C")==1 else "WA")
s=list(input())
flag=1
if s[0]!='A':
    flag=0
if 'C' not in s[2:-2]:
    flag=0
if s.count('C')!=1:
    flag=0
if 'A' in s:
    s.remove('A')
if 'C' in s:
    s.remove('C')
s=''.join(s)
if s.islower():
    pass
else:
    flag=0
if flag==1:
    print('AC')
else:
    print('WA')
s = input()
if s[0]==s[0].upper()and s[2]==s[2].upper() and s[3:-1]==s[3:-1].lower()and s[1]==s[1].lower()and s[-1]==s[-1].lower():
    print("AC")
else:
    print("WA")
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    S = list(input())

    isWA = False
    if S[0] != 'A':
        isWA = True

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

    for s in S:
        if s == 'A' or s == 'C':
            continue
        if s.isupper():
            isWA = True

    if isWA:
        print('WA')
    else:
        print('AC')
    

if __name__ == '__main__':
    main()
# -*- coding: utf-8 -*-
"""
Created on Wed May 13 16:16:15 2020

@author: shinba
"""
import sys

s = list(input())

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

t = s[1:len(s)-1]

if t.count("C") != 1:
    print("WA")
    sys.exit()
else:
    t.remove("C")

t.append(s[-1])

if "".join(t) == "".join(t).lower():
    print("AC")
else:
    print("WA")
S = input()
T_1 = S[0]=="A"
T_2 = S[2:-1].count("C")==1
T_3 = S[2:].replace("C", "").islower()
print("AC" if T_1 and T_2 and T_3 else "WA")
#!/usr/bin/env python3

s = str(input())

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


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

if flag == 0:
    print("WA")
else:
    print("AC")
s = str(input())
ans = 0
if s[0] == 'A':
    for i in range(3, len(s)-1):
        if s[i] == 'C':
            ans += 1
    if ans == 1:
        print('AC')
        exit()
else:
    print('WA')
S=input()
k=0
if S[0]=='A':
    k=100
if k==100:
    for i in range(2,len(S)):
        if S[i]=='C':
            k=i
            break
if 'a'<=(S[1:k] and S[k+1:])<='z':
    print('AC')
    exit()
if k==100:
    print('WA')
s=input()

if s[0]=="A":
  if s[2:-1].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())
k=s[2:-1]
m=k.replace('C', 'c',1)
print(k)
print(m)
if k.count('C')==1 and s[0]=='A' and m==k.lower():
    print('AC')
else:
    print('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:]
print(sss)
if sss.islower():
    print("AC")
    sys.exit()

print("WA")
S = input()
s = list(S)
j= 0
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]

if S.isupper():
    print('WA')
    exit()

print('AC')