peterverebics/CodeNet_Python_118 huggingface dataset:
S = input()
ans = 'WA'
if S[0] == 'A':
    if S[2 : -1].count('C') == 1:
        if S[0].replace('A', 'a') + S[1] + S[2 : -1].replace('C', 'c') + S[-1] == S.lower():
            ans = 'AC'
print(ans)
"""
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 f(r): return r[0] == 'A' and  collections.Counter(r[2:-1])['C'] == 1 and  all([l in set(['A', 'C']) or l.lower() ==l for l in r ])

print 'AC' if f(raw_input()) else 'WA'
S = input()
if not S[0] == 'A':
    print('WA')
    exit()
if not S[2:-1].count('C') == 1:
    print('WA')
    exit()
if not (S[1] + S[2:-1].replace('C', '') + S[-1]).islower():
    print('WA')
    exit()
print('AC')
# 25minutes. 
# 簡単なのだが問題をちゃんと読めていないため'WA'を2回繰り返した！

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

x = 0
for j in l:
    if j in m:
        x += 1

a = 0
for i in range(2,len(l)-1):
    if l[i] == 'C':
        a += 1
if a == 1 and l[0] == 'A' and x == 2:
    print('AC')
else:
    print('WA')
s = input()
if s[0] != "A":
    ans = "WA"
elif ord(s[1]) < 91:
    ans = "WA"
elif ord(s[-1]) < 91:
    ans = "WA"
else:
    ans = "AC"
    c = 0
    for i in range(2, len(s) - 1):
        if s[i] == "C":
            c += 1
        elif ord(s[i]) < 91:
            ans = "WA"
            break
    if c != 1:
        ans = "WA"

print(ans)
import re
s=input()
S=list(s)

if S[0]=="A" and S[2:-1].count('C')==1 and len(S)-len(re.findall('[a-z]',s))==2:
  print('AC')
else:
  print('WA')
S = list(input().strip())
f = True
if S[0] == "A":
    S[0] = "a"
else:
    S[0] = "X"
if S[2:-1].count("C") == 1:
    S[S.index("C")] = "c"
else:
    S[0] = "X"
if "".join(S) == "".join(S).lower():
    print("AC")
else:
    print("WA")
s=input();print('WAAC'['A'==s[0] and 'C'in s[2:-1] and s.count('C')==1 and s.count('A')==1  and s.replace('A','').replace('C','').islower()::2])
S = input()
flg1 = flg2 = flg3 = True
if not S[0] == 'A':
    flg1 = False
if not S.count('C', 2, -1) == 1:
    flg2 = False
j = len(S) + 1
for i in range(len(S)):
    if S[i] == 'C':
        j = i
for i in range(len(S)):
    if i == 0 or i == j:
        continue
    else:
        if S[i].islower() == False:
            flg3 = False
flg = flg1 * flg2 * flg3
print('AC' if flg else 'WA')
s = input()
ok = True
ss = ''
# print(s[2:-1])
if s[0] == 'A': 
    if 'C' in s[2:-1]:
        for i in range(len(s)):
            if s[i].isupper():
                ss += s[i]
        if ss == 'AC':
            pass
        else:
            ok = False
    else:
        ok = False
else:
    ok = False

if ok:
    print('AC')
else:
    print('WA')
S = input()
flag = 1
if S[0] != 'A':
    flag = 0
if not 'C' in S[2:-1]:
    flag = 0
cnt = 0
for i in S:
    if i in [chr(i) for i in range(65, 65+26)]:
        cnt += 1
if cnt != 2:
    flag = 0
if flag:
    print('AC')
else:
    print('WA')
#B - AcCepted
S = list(input())
judge = 0
if S[0].isupper() == True:
    judge += 1
if 'C' in S[2:-1] and S.count('C') == 1:
    judge += 1
if 'C' in S:
    S.remove('C')
if 'A' in S:
    S.remove('A')
if all(S[i].islower() for i in range(len(S))) == True:
    judge += 1
if judge == 3:
    print('AC')
else:
    print('WA')
S = input()
length = len(S)

match = True
if S[0] != "A":
    match = False
elif S[2:length-1].count("C") != 1:
    match = False

for i in S:
    if i not in ["A", "C"] and i.isupper():
        match = False

print("AC" if match else "WA")
import re

S = input()
frag_1 = 0
frag_2 = 0
frag_3 = 0

if S.find("A") == 0:
  frag_1 = 1
if 1 < S.find("C") and S.find("C") < len(S)-1:
  frag_2 = 1
if len(re.findall('[A-Z]', S)) == 2:
  frag_3 = 1

if frag_1 == 1 and frag_2 == 1 and frag_3 == 1:
  print("AC")
else:
  print("WA")
"""
author : halo2halo
date : 23, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

S = list(readline().decode('utf8').rstrip())
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)

print('AC' if bl else 'WA')
S = list(input())
ans = 'AC'

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

tmp = 0
for s in S:
    if ord('a') <= ord(s) <= ord('z'):
        tmp += 1


if tmp != (len(S) - 2):
    ans = 'WA'

print(ans)
import sys
s= input()
n =len(s)
Al = [chr(_)  for _ in range(97,124)]
if s[0] == "A" and s[2:n-1:1].count("C")==1:
    for i in range(1,n):
        if not(s[i] in Al or s[i]=="C"):
            print('WA')
            sys.exit()
    print('AC')
    sys.exit()
else:
    print('WA')
#104B
s = input()
c_list = []
c_count = 0
answer = "WA"
for i in range(2,len(s)-1):
    if s[i] == "C":
        c_list.append(i)
    if s[i].islower() == False:
        c_count += 1
if s[0]=="A" and s[1].islower()==True and s[-1].islower()==True and len(c_list)==1 and c_count==1:
    answer="AC"
print(answer)
S = input()
C_cnt = 0
if S[0] == 'A' and S[1].islower() and S[-1].islower():
    temp = S[2:len(S)]
    if temp.count('C') == 1:
        for t in temp:
            if t != "C" and t.isupper() == True:
                print("WA")
                exit()
        else:
            print("AC")
            exit()
print("WA")
import string
s=string.ascii_lowercase
s+="C"
S=input()
buttanA=False
buttanB=False
buttanC=True


for i in range(len(S)):
    if S[0]=="A":
        buttanA=True
    if S[i]=="C" and 2<=i<len(S)-1:
        if buttanB==False:
            buttanB=True
        else:
            print("WA")
            exit()
    if S[i] not in s and 1<=i<len(S):
        buttanC=False

if buttanA==buttanB==buttanC==True:
    print("AC")
else:
    print("WA")
def solve():
    S = input()
    cnt = 0
    if S[0] != 'A':
        print('WA')
        exit()
    for i in range(1, len(S)):
        if S[i].isupper():
            if i == 1 or i == len(S) - 1 or S[i] != 'C':
                print('WA')
                exit()
            cnt += 1
    if cnt != 1:
        print('WA')
        exit()
    print('AC')






if __name__ == "__main__":
    solve()
S=input()

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

count=0
for i in range(2,len(S)-1):
  if S[i]=='C':
    count+=1
if count!=1:
  print('WA')
  exit()

for i in range(2,len(S)-1):
  if S[i]=='C':
    break

S=S[1]+S[2:i]+S[i+1:len(S)]

if S.islower():
  print('AC')
else:
  print('WA')
s=list(input())
print('AC' if (s[0]=='A') and ('C' in s[2:-1]) and all(i.islower() for i in s if not i in ['A','C']) and (s.count('A')==s.count('C')==1) else 'WA')
import sys
s=input()
cnt=0
if s[0]!='A':
    print('WA')
elif s[1].isupper():
    print('WA')
elif s[-1].isupper():
    print('WA')
else:
    for i in range(2,len(s)-1):
        if s[i]=='C':
            cnt+=1
        else:
            if s[i].isupper():
                print('WA')
                sys.exit()
    if cnt==1:
        print('AC')
    else:
        print('WA')
s = input()

cond = True

if s[0] != "A":
    cond = False

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

s = s.replace("C", "")
if not s[1:].islower():
    cond = False

print("AC" if cond else "WA")
s = input()
if s.count('C')==1:
    a=s.index('C')
else:
    a=0
print('AC' if s[0]=='A' and s.count('C')==1 and s[1:a]+s[a+1:]==(s[1:a]+s[a+1:]).lower() and 1<a<len(s)-1 else 'WA')
s = input()

alphabet = 'abcdefghijklmnopqrstuvwxy'

ans = 'AC'

C_count = s.count('C')
if C_count == 1 and s[0] == 'A' and s[1] != 'C' and s[-1] != 'C':
    s = s.replace('C', 'c')

    for i in range(1, len(s)):
        if s[i] in alphabet:
            pass
        else:
            ans = 'WA'
            break
else:
    ans = 'WA'

print(ans)
S = list(input())

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

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

count = 0
for i in range(0,len(S),1):
    if ord(S[i])<95:
        count+=1

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

print("AC")
import re
S = input()
result = re.match('^A[a-z]{1}[a-z]{0,6}C[a-z]{1,7}$', S)

if result:
  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")
s = str(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()
if S[0]!="A":
    print("WA")
    exit()
else:
    if S[2:-1].count("C")!=1:
        print("WA")
        exit()
    else:
        x=S.index("C")
        for i in range(len(S)):
            if i==0 or i==x:
                pass
            else:
                if 65<=ord(S[i])<=90:
                    print("WA")
                    exit()
print("AC")
import sys
S = input()

if not (S[0] == "A" and "C" in S[2:len(S)-1]):
    print("WA")
    sys.exit()

S = sorted(S)

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

if not "a" <= S[2] <= "z":
    print("WA")
    sys.exit()

print("AC")
S = input()
F = True
if S[0] != "A":
  F =False
if not("C" in S[2:-1]):
  F = False
if S[1:].count("C")==1:
  for i in range(1,len(S)):
    if S[i] != "C" and S[i].isupper():
      F = False
elif S[1:].count("C")>1:
  F = False
print("AC" if F 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":
    x = s.find("C")
    if 2<=x and x != len(s)-1:
        s = [i for i in s]
        s[0]="a"
        s[x]="c"
        s = "".join(s)
        if s.islower():
            print("AC")
            exit()
print("WA")
from collections import Counter
s = input()
fist = s.replace('A', '').replace('C', '')

if not fist.islower():
    print('WA')
else:
    seco = s[2:-1]
    cnt = Counter(seco)
    if not cnt['C'] == 1:
        print('WA')
    else:
        if s[0] == 'A':
            print('AC')
        else:
            print('WA')
s = input()
ok = True

ok &= s[0] == 'A'
ok &= s[2:-1].count('C') == 1
ok &= s[1:].replace('C', '').islower()

print('AC' if ok else 'WA')
S = input()

Cflag = 0
if S[0] == 'A':
    for i in range(1, len(S)):
        if S[i] == 'C' and Cflag == 0 and 2 <= i < len(S)-1:
            Cflag = 1
        elif S[i] == 'C' and Cflag != 0:
            print('WA')
            exit()
        elif ord(S[i]) < 97:
            print('WA')
            exit()
    if Cflag == 1:
        print('AC')
    else:
        print('WA')
else:
    print('WA')
def check(s):
  if s[0]!="A":
    return 0
  c = 0
  for i in range(1,len(s)):
    if s[1].isupper() or s[-1].isupper():
      return 0
    if s[i].isupper():
      if c!=0:
        return 0
      if s[i]=="C":
        c=1
      else:
        return 0
  if c==0:
    return 0
  return 1    

s = list(input())
if check(s):
  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")
else:
    print("WA")
S="abcdefghijklmnopqrstuvwxyz"
s=input()
n=len(s)
flag=0
if s[0]!="A":
    flag=1
cut=s[2:n-1]
if cut.count("C")!=1:
    flag=1
else:
    cut=s[1:]
    for c in cut:
        if ((not c in S) and c!="C"):
            flag=1
            break

if flag:
    print("WA")
else:
    print("AC")
# -*- coding: utf-8 -*-
# 標準入力を取得
S = input()

# 求解処理
ans = "AC"
if S[0] != "A":
    ans = "WA"

if S[2:-1].count("C") != 1:
    ans = "WA"
else:
    index = 2 + S[2:-1].index("C")
    if not (S[1:index] + S[index + 1:]).islower():
        ans = "WA"

# 結果出力
print(ans)
s = input()
n = len(s)

f = False
ans = s[0] == 'A'
for i in range(1,n):
    if 'a' <= s[i] <= 'z': continue

    if not f and i>1 and i<n-1 and s[i] == 'C':
        f = True
        continue

    ans = False
    break

if ans and f:
    print('AC')
else:
    print('WA')
import sys


def resolve(in_):
    S = next(in_).strip()
    
    if S[0] != 'A':
        return False
    if S.count('C', 2, -1) != 1:
        return False
    i = S.find('C')
    a = S[1:i]
    b = S[i + 1:]
    if not (a.islower() and b.islower()):
        return False
    
    return True


def main():
    answer = resolve(sys.stdin)
    print('AC' if answer else 'WA')


if __name__ == '__main__':
    main()
s = input()
def WA():
  print('WA')
  exit()
if s[0] != 'A':
  WA()
if ord(s[-1]) < ord('a') or ord('z') < ord(s[-1]):
  WA()
if ord(s[1]) < ord('a') or ord('z') < ord(s[1]):
  WA()
s = s[1:]
ccnt = 0
for i in s[1:-1]:
  if i == 'C':
    ccnt += 1
  elif ord(i) < ord('a') or ord('z') < ord(i):
    print('WA')
    exit()
if ccnt != 1:
  print('WA')
  exit()
else:
  print('AC')
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() == True:
          print('AC')
     else:
          print('WA')
else:
     print('WA')
S=input()
ans = "WA"
if S[0] == "A" and ("a" <= S[1] <= "z") and ("a" <= S[-1] <= "z"):
  s0 = S[2:-1]
  f = 0
  for i in range(len(s0)):
    if s0[i] == "C":
      if f != 0:
        ans = "WA"
      else:
        ans = "AC"
        f = 1

print(ans)
s=input()
ans="AC"
if s[0]!="A":
    ans="WA"
c=0
idx=0
for i in range(2,len(s)-1):
    if s[i]=="C":
        c+=1
        idx=i
if c!=1:
    ans="WA"
small={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"}
for i in range(1,len(s)):
    if i!=idx:
        if s[i] not in small:
            ans="WA"
            break
print(ans)
s = input()

if s[0] == "A" and "C" in s[2:-1]:
    d = s[2:-1].index("C")
    A = s[1:d+2] + s[d+3:]
    B = [j for j in range(ord("a"), ord("z") + 1)]
    t = 0
    for i in A:
        if ord(i) not in B:
            t = 1
            break
    if t == 0:
        print("AC")
    else:
        print("WA")
else:
    print("WA")
s = input()
if s[0].isupper() 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=list(map(lambda x:x,input()))

F=(S[0]=="A")
F&=(S[2:-1].count("C")==1)

if F:
    S.remove("A")
    S.remove("C")
    for s in S:
        F&=(s==s.lower())
if F:
    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()
if S[0]!="A":
  print("WA")
  exit()
if "C" not in list(S[2:-1]):
  print("WA")
  exit()
S=list(S)
ans=0
for i in S:
  if i.islower()==True:
    ans+=1
if ans!=(len(S)-2):
  print("WA")
  exit()
print("AC")
S = input()

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

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

for i in S[1:].split('C'):
    if not i.islower():
        print('WA')
        exit()

print('AC')
s = list(input())


if s[0] == "A":
    if len([True for c in s[2:-1:] if c == "C"]) == 1:
        s.remove("A")
        s.remove("C")
        for c in s:
            if not c.islower():
                print("WA")
                exit()
        print("AC")
        exit()
print("WA")
s = list(input())
status = 0
c = 0
word = [chr(ord('A') + i) for i in range(26)]

if s[0] != "A":
    status = 1
elif s.count("C") == 0:
    status = 1
else:
    if s.count("C") == 1 and 2<=s.index("C")<=len(s)-2:
        del s[0]
        del (s[s.index("C")])
        for i in word:
            if i in s:
                status = 1
                break
    else:
        status = 1

if status == 0:
    print("AC")
else:
    print("WA")
s = input()
ac = True
c = True
if s[0] != "A":
  ac = False
if not ord("a") <= ord(s[1]) <= ord("z"):
  ac = False
if not ord("a") <= ord(s[-1]) <= ord("z"):
  ac = False
for i in range(2, len(s)-1):
  if s[i] == "C":
    if c:
      c = False
    else:
      ac = False
  else:
    if not ord("a") <= ord(s[i]) <= ord("z"):
      ac = False
if c:
  ac = False
if ac:
  print("AC")
else:
  print("WA")
#!/usr/bin/env python3
s=input()
if s[0] == 'A' and 1 < s.find('C') < len(s) - 1 and (s[1:s.index('C')]+s[s.index('C')+1:]).islower():
    print("AC")
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")
s = input()
ans = 'AC'
if s[0] != 'A':
    ans = 'WA'
if not('C' in s[2:-1]):
    ans = 'WA'
s = s.replace('A','')
s = s.replace('C','',1)
for i in s:
    if ord(i) < ord('a') or ord(i) > ord('z'):
        ans = 'WA'
print(ans)
s = str(input())
if s[0] == 'A' and s[2:len(s)-1].count('C') == 1:
    j = s.index('C')
    w = s[1:j] + s[j+1:]
    if w.lower() == w:
        print('AC')
    else:
        print('WA')
else:
    print('WA')
s = input()
ans = 'AC'
ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(s)):
    if i == 0:
        if s[i] != 'A':
            ans = 'WA'
    if i == 1 or i == len(s)-1:
        if s[i] not in ascii_lowercase:
            ans = 'WA'
if s[2:-1].count('C') != 1:
    ans = 'WA'
print(ans)
S = input()
charset = set(list(S))
if 'A' in charset:
    charset.remove('A')
if 'C' in charset:
    charset.remove('C')
# print(f'S:{S} charset:{charset}', file=sys.stderr)
if S[0] == 'A' and S[2:-1].count('C') == 1 and ''.join(charset).islower():
    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 cnt!=1:
    print('WA')
    exit()
cnt=0
for i in s:
    if i.isupper():
        cnt+=1

if cnt!=2:
    print('WA')
else:
    print('AC')
S=input()
print('AC'if'A'in S and 'C'in S[2:-1] and S[1:].replace('C','',1).islower() else'WA')
s = input()
n = len(s)
p = list(s[2:(n-1)])
if s[0] == "A":
    flag = 1
else:
    print("WA")
    quit()
cnt = 0
for i in range(2,n-1):
    if s[i] == "C":
        cnt += 1
    elif s[i].isupper():
        flag = 0
if flag and s[1].islower() and s[n-1].islower() and cnt==1:
    print("AC")
else:
    print("WA")
s = input()
num_C = 0

for i in range(len(s)):
    if i == 0:
        if s[i] != 'A':
            print('WA')
            exit() 
    elif i >= 2 and i <= len(s)-2:
        if s[i] == 'C': num_C += 1
    else:
        if ord(s[i]) < ord('a') or ord(s[i]) > ord('z'):
            print('WA')
            exit()
if num_C != 1:
    print('WA')
    exit()
print('AC')
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")
#!/usr/bin/env python3
import collections

S = input()
a = S[0] == "A"
b = collections.Counter(S[2:-1])["C"] == 1
c = S.replace("A", "").replace("C", "").islower()

ans = "AC" if a and b and c else "WA"

print(ans)
S = input()


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

def ok(s):
    if S[0] != 'A':
        return False
    if S[-1] == 'C' or S[1] == 'C':
        return False

    if len(list(filter(lambda x : x == 'C', S[2:]))) != 1:
        return False


    if list(map(lambda x: x.lower() if x not in ['A', 'C'] else x, s)) != s:
        return False

    return True

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

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

print("AC" if z else "WA")
S = input()
NG = ['B','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
ans = 'AC'
if S[2:-1].count('C') != 1:
  ans = 'WA'
for i in range(len(S)):
  if i == 0 and S[0] != 'A':
    ans = 'WA'
    break
  elif i == S[2:-1].find('C'):
    continue
  elif S[i] in NG:
    ans = 'WA'
print(ans)
def main():
    string = input()
    if string[0] == "A" and string[2:-1].count("C") == 1 and string.replace("A", "").replace("C", "").islower():
        print("AC")
    else:
        print("WA")


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

ll = len(s)

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 == ll - 1 or s[i] != 'C':
            ans = 'WA'
        cnt += 1

if cnt != 1:
    ans = 'WA'

print(ans)
s=list(input())
s1=s[2:-1]
f=True
if s[0]!='A':
	f=False
elif 'C' not in s1:
	f=False
else:
	s.remove('A')
	s.remove('C')
	if str(s).islower():
		pass
	else:
		f=False
if f:
	print('AC')
else:
	print('WA')
import sys
s = list(input())

if s[0] != "A":
    print("WA"); sys.exit()
else:
    s[0] = "a"
    
if "C" in s[2:-1]:
    s[s[2:-1].index("C") + 2] = "c"
else:
    print("WA"); sys.exit()

if all([i.islower() for i in s]):
    print("AC")
else:
    print("WA")
S=str(input())
temp=0
j=0
if S[0]!='A':
    print('WA')
    exit()
for i in range(2,len(S)-1):
    if S[i]=='C':
        temp+=1
        j=i
if temp!=1:
    print('WA')
    exit()
for i in range(len(S)):
    if i!=0 and i!=j:
        if S[i].isupper():
            print('WA')
            exit()
print('AC') 
exit()
S=input()
chk = [False, False, False]
if S[0]=="A":
    chk[0]=True

ind = 0
for i in range(2, len(S)-1):
    if S[i]=="C":
        chk[1]=True
        ind=i

chk[2]=True
for i in range(len(S)):
    if i==ind or i==0:
        continue
    if S[i].isupper():
        chk[2]=False

if chk[0] and chk[1] and chk[2]:
    print("AC")
else:
    print("WA")
word = input()
import re
dst = ""
if word[0] == "A":
    if len(re.findall("C", word[2:-1])) == 1:
        if len(re.findall(r"[a-z]", word)) == len(word) - 2:
            dst = "AC"
if not dst:
    dst = "WA"
print(dst)
S = input()
L = [chr(i) for i in range(97, 97+26)]
if S[0] == "A":
  c = 0
  for i in range(2,len(S)-1):
    if S[i] == "C":
      c +=1
      k = i
  if c == 1:
    T = "AC"
    for j in range(1,len(S)):
      if j != k:
        if not S[j] in L:
          T = "WA"
          break
    print(T)
  else:
      print("WA")
else:
  print("WA")
S = input()

ans = True

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

if not ('a' <= S[1] and S[1] <= 'z'):
    ans = False

cnt = 0
for s in S[2:-1]:
    if s == 'C':
        cnt += 1
    else:
        if not ('a' <= s and s <= 'z'):
            ans = False

if cnt != 1:
    ans = False

if not ('a' <= S[-1] and S[-1] <= 'z'):
    ans = False

if ans:
    print("AC")
else:
    print("WA")
S = input()

if S[0] == 'A' and S[2:-1].count('C') == 1: 
    s = S.replace('A', 'a').replace('C', 'c')
    t = s.lower()
    if s == t:
        print('AC')
        exit()
print('WA')
s=input()
print("AC" if "C" in s[2:-1] and "A" is s[0] and s[1:].replace("C","",1).islower() else "WA")
s=list(input())
n=len(s)

if s[0]=="A" and "C" in s[2:n-1]:
    check=s[1:]
    check.remove("C")
    s="".join(check)
    if s==s.lower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")
from collections import Counter
s = list(input())
n = len(s)
count = Counter(s[2:-1])
lower = [i for i in s if ord('a')<=ord(i)<=ord('z')]

if count.get('C'):
    if count['C']==1 and s[0]=='A' and len(lower)==n-2:
        print('AC')
        exit()
print('WA')
S=str(input())
letter="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
condition1 = S[0]=='A'
condition2 = len([1 for x in S[2:len(S)-1] if x=="C"]) == 1
count=0
for i in range(len(S)):
  if len([1 for x in letter if x==S[i]]) == 1:
    count = count + 1
condition3 = count == 2
if condition1 & condition2 & condition3:
  print('AC')
else:
  print('WA')