Problem:
 Score : 200 points    Problem Statement You are given a string S . Each character of S is uppercase or lowercase English letter.
Determine if S satisfies all of the following conditions:   The initial character of S is an uppercase A .  There is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).  All letters except the A and C mentioned above are lowercase.       Constraints  4 ≤ |S| ≤ 10 ( |S| is the length of the string S .)  Each character of S is uppercase or lowercase English letter.         Input Input is given from Standard Input in the following format:  S       Output If S satisfies all of the conditions in the problem statement, print AC ; otherwise, print WA .        Sample Input 1 AtCoder      Sample Output 1 AC  The first letter is A , the third letter is C and the remaining letters are all lowercase, so all the conditions are satisfied.       Sample Input 2 ACoder      Sample Output 2 WA  The second letter should not be C .       Sample Input 3 AcycliC      Sample Output 3 WA  The last letter should not be C , either.       Sample Input 4 AtCoCo      Sample Output 4 WA  There should not be two or more occurrences of C .       Sample Input 5 Atcoder      Sample Output 5 WA  The number of C should not be zero, either.

Solution (Python):
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')

Solution (Python):
import sys
s = input()
state = False
if s[0] != "A":
    print("WA")
    sys.exit()
cnt = 0
for i in range(2,len(s)-1):
    if s[i] == "C":
        cnt +=1
if cnt != 1:
    print("WA")
    sys.exit()
for i in range(len(s)):
    if s[i] == "A":
        continue
    elif s[i] == "C":
        continue
    elif s[i].islower():
        continue
    else:
        print("WA")
        sys.exit()
print("AC")

Solution (Python):
s=input()

if s[0]=="A":
  if s[2:-1].count("C")==1:
    if s.count("A")==1 and s.count("C")==1 and s[1].islower()==True and s[-1].islower()==True:
      print("AC")
    else:
      print("WA")
  else:
    print("WA")
else:
  print("WA")

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

Solution (Python):
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()

Solution (Python):
S = input()

if S[0]=='A' and S[2:len(S)-1].count('C') == 1:
    flag = True
    for i in range(1,len(S)):
        if ord(S[i]) < ord('a') and i != S.index('C'):
            flag = False
            break
    if flag:
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Solution (Python):
s = input()
flg = 0
if s[0] != "A":
  flg = 1
if s[2:-1].count("C") != 1:
  flg = 1
else:
  l = s.index("C")
  s = s[1:l] + s[l+1:]
  if s.islower():
    pass
  else:
    flg = 1
if flg == 1:
  print("WA")
else:
  print("AC")

Solution (Python):
import numpy as np

S = input()
cond1 = (S[0] == 'A')

cntC = S.count('C', 2, len(S)-1)
cond2 = (cntC == 1)

cnt_lower = 0
for c in S:
    if c.islower():
        cnt_lower += 1
cond3 = (cnt_lower == len(S)-2)

if(cond1 and cond2 and cond3):
    print("AC")
else:
    print("WA")

Solution (Python):

import sys
import itertools
import math

i=0
j=0


S=input()













sentence_list=[]





















first_term=0
second_term=0






p=-10000
sentence_list=list(S)


if len(S) <4 or len(S) > 10:
    print("WA")
    sys.exit()

if sentence_list[0]=="A":
    
    
    pass
else:
    print("WA")
    sys.exit()

for j in range(len(sentence_list)-3):
    
    
    
        

        
    if sentence_list[j+2]=="C":
        
        p=j+2
        break


if p> 0:
    del sentence_list[p]
if p< 0:
    print("WA")
    sys.exit()
del sentence_list[0]


S="".join(sentence_list)

if S.islower()==True:
    print("AC")
    sys.exit()

print("WA")











distance = 0


'''p[, r]で
長さrのタプル列、重複なしのあらゆる並びを表す
今回はリストlの重複なしの並び替え順序を新たなリストに収納している
並び方を計算しリストに収納しているイメージ
l[0,1,2]
l[0,2,1]これにもリスト番号が0,1,2と割り振られている
これが全通り入っている
これ作った人はすごい
自分も早く理解したい
'''



'''
各経路の距離を足していき全距離分を経路数
で割れば平均距離が出るので各経路ごとの距離は
不必要と判断されている。
'''

i=0
j=0




for j in range(3):
        pass

Solution (Python):
s=input()

low=set(chr(ord('a')+x) for x in range(26))

if(s[0]=='A' and s[2:-1].count('C')==1 and set(s)-set('AC')<=low):print("AC")
else:print("WA")

Solution (Python):
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:-1].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()

Solution (Python):
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")

Solution (Python):
s=input()
ss=s[2:-1]
flag=1
for i in s:
  if i.isupper() and i!="A" and i!="C":
    flag=0
if s[0]=="A" and ss.count("C")==1 and flag==1:
  print("AC")
else:
  print("WA")

Solution (Python):
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')

Solution (Python):
s=list(input())

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

print("WA")

Solution (Python):
s=input()

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

cnt=0
for i in range(2,len(s)-1):
   if s[i] == "C":
       cnt+=1
if cnt!=1:
    print("WA")
    exit()

for i in range(1,len(s)):
    if s[i] == "C" and 2<=i<len(s)-1:
        continue
    if not s[i].islower():
        print("WA")
        exit()
print("AC")

Solution (Python):

s=input()
x=s[2:-1]
flag=True
if s[0]!="A" or s[1].isupper() or s[-1].isupper():
    flag=False
cnt=0
for i in range(len(x)):
        if x[i]=="C":
            cnt+=1
        else:
            if x[i].islower()==False:
                flag=False
if cnt!=1:
    flag=False
if flag:
    print("AC")
else:
    print("WA")

Solution (Python):
import re
print("AC" if re.match("^A[a-z]+C[a-z]+$", input()) else "WA")

Solution (Python):
S = input()

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

Solution (Python):



S = input()


is_a_ok = False
is_s_ok = False
s_len = len(S)
count = 0


for i in range(s_len):
    if i==0 and S[i]=='A':
        is_a_ok = True
        count += 1
        continue

    if i+1>=3 and (i+1)<=(s_len-1):
        if S[i]=='C':
            is_s_ok = True
            count += 1
            continue

    if S[i].isupper():
        count += 1

if count==2 and is_a_ok and is_s_ok:
    print("AC")
else:
    print("WA")

Solution (Python):
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")

Solution (Python):
a = ord('a')
z = ord('z')
S = input()

ans = 'WA'
if S[0] == 'A':
    if S[2:-1].count('C') == 1:
        for i, c in enumerate(S):
            if i == 0 or c == 'C':
                continue
            else:
                if a <= ord(c) <= z:
                    continue
                else:
                    break
        else:
            ans = 'AC'

print(ans)

Solution (Python):
import re
print("WA" if re.match('^A[a-z]+C[a-z]+$',input()) == None else "AC")

Solution (Python):
S = input()
T = S[2:-1]
c = 0
U = ''
for t in T:
  if t =='C':
    c+=1
  elif t.isupper():
    print('WA')
    exit()
if S[0]=='A' and c==1 and S[1].islower() and S[-1].islower():
  print('AC')
else:
  print('WA')

Solution (Python):
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")

Solution (Python):


import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

from curses.ascii import islower

S = list(ns())
N = len(S)
ccnt = 0
lcnt = 0

for i in range(1, N):
    if S[i] == 'C' and i < N - 1 and i > 1:
        ccnt += 1
    if islower(S[i]):
        lcnt += 1

if lcnt == N - 2 and ccnt == 1 and S[0] == 'A':
    print("AC")
else:
    print("WA")

Solution (Python):
s = input()
s_2 = s[2:-1]
c = 0 
f = 1

if s[0] == 'A': 
    for i in range(len(s_2)): 
        if s_2[i] in 'C':
            f = 1
            for j in range(len(s)):
                if s[j].isupper():
                    c += 1
                
            if c == 2: 
                print('AC')
            else:
                print('WA')
            break
        else:
            f = 0
            pass

else:
    print('WA')
    
if f == 0:
    print('WA')

Solution (Python):
s=input()
if s[0]=='A' and s[2:-1].count('C')==1:
    for i in s[1:]:
        if i !='C' and i!=i.lower():
            print('WA')
            exit()
    print('AC')
else:
    print('WA')

Solution (Python):
S = input()
cnt = 0
if S[0] == "A":
    for i in S[2: len(S) - 1]:
        if i == "C":
            cnt += 1
sr = S.replace("A", "")
src = sr.replace("C", "")
if src.islower() and cnt == 1:
    print("AC")
else:
    print("WA")

Solution (Python):
s = input()
if s[0] != 'A':
    print('WA') 
else:
    ii = s.count('C',2,-1)
    if ii != 1:
        print('WA')
    else:
        s_1 = s.lstrip('A')
        s_2 = s_1[1:-2].replace('C','')
        s_1 = s_1[0] + s_1[-1]
        s = s_1 + s_2
        if s.islower() == True:
            print('AC')
        else:
            print('WA')

Solution (Python):
S = input()
if S[0] != "A":
  print("WA")
  exit()
elif S[2:-1].count("C") != 1 or S[:2].count("C") != 0 or S[-1:].count("C") != 0:
  print("WA")
  exit()
else:
  S = S[1:].replace("C", "")
  if S.islower():
    print("AC")
  else:
    print("WA")

Solution (Python):
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")

Solution (Python):








def resolve():
    s=str(input())
    while True:
        if s[0]!='A':
            print('WA')
            break


        if s[2:-1].count('C')!=1:
            print('WA')
            break
        else:
            s=s[0:s.index('C')]+s[s.index('C')+1:]
            if s==s.capitalize():
                print('AC')
                break
            else:
                print('WA')
                break





resolve()

Solution (Python):
S = input()

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

Solution (Python):
s = input()
ans = "AC"
if s[0] != "A":
  ans = "WA"
elif s[-1].upper() == s[-1]:
  ans = "WA"
elif s[1].upper() == s[1]:
  ans = "WA"
elif s[2:-1].count("C") != 1:
  ans = "WA"
elif not s[2:].replace("C", "").islower():
  ans = "WA"
  
print(ans)

Solution (Python):
s = input()
f = False
f2 = True
c = 0
if s[0] =="A":
    f = True
for x in s[2:len(s)-1]:
    if x == "C":
        c +=1
    else:
        if x.isupper() or s[-1].isupper():
            f2 = False
if not s[1].islower():
    f2 = False
if f and c == 1 and f2:
    print("AC")
else:
    print("WA")

Solution (Python):
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')

Solution (Python):
def l():
    print("WA")
    exit()
s = input()
if s[0] != "A": l()
c = 0
for i in s[2:-1]:
    if i == "C":
        c += 1
if c != 1: l()
print("AC") if s[1].islower() and s[-1].islower() else l()

Solution (Python):
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):  
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


s = list(map(str, input()))

for i in range(-1, 2):
    
    if s[i] == 'C':
        print('WA')
        exit()

for c in s[1:]:
    if c == 'A':
        print('WA')
        exit()


def cnt(s):
    a = 0
    for i in range(2, len(s)-1):
        
        if s[i] == 'C':
            a += 1
    if a == 1:
        return True
    else:
        return False


def remove(s):
    s.remove('A')
    s.remove('C')
    return s


def func(s):
    if s[0] == 'A':
        pass
    else:
        return False
    if cnt(s):
        pass
    else:
        return False
    return True


if func(s):
    s = remove(s)
    aa = 0
    for i in range(len(s)):
        if s[i].islower():
            aa += 1
    if aa == len(s):
        print('AC')
        exit()
print('WA')

Solution (Python):
s = input()
ok=True
if s[0]!='A': ok=False
n = s.find('C')
if not 2<=n<len(s)-1: ok=False
for i in range(len(s)):
    if i!=0 and i!=n and s[i].isupper(): 
        ok=False
print('AC'if ok else 'WA')

Solution (Python):
s=input()
cnt=0
if s[0] != 'A':
    print('WA')
    exit()
if s[2:len(s)-1].count('C') != 1:
    print('WA')
    exit()
else:
    for i in range(1,len(s)):
        if s[i]=='C':
            continue
        if s[i].isupper():
            print('WA')
            exit()

print('AC')

Solution (Python):
S = input()
ans = "WA"
if S[0] == "A":
    tmp = S[2:len(S)-1]
    if tmp.count("C") == 1:
        c = tmp.index("C")
        count = 0
        for i in range(1,len(S)):
            tmp2 = S[i]
            if tmp2.islower():
                count += 1
        if count == len(S) - 2:
            ans = "AC"
print(ans)

Solution (Python):
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')

Solution (Python):
S = input()
if S[0] != 'A':
    print('WA')
    exit()
c_count = 0
for i in range(2,len(S)-1):
    if S[i] == 'C':
        c_count += 1
if c_count != 1:
    print('WA')
    exit()
for i in range(1,len(S)):
    if S[i] == 'C':
        continue
    if S[i].isupper():
        print('WA')
        exit()
print('AC')

Solution (Python):


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")

Solution (Python):
s = list(input())

a = False
c = False
small = False
for i in range(len(s)):
    if i == 0 and s[i] == "A":
        a = True
    elif a == True and i >= 2 and i < len(s) - 1 and s[i] == "C" and c == False:
        c = True
    elif s[i] >= "a" and s[i] <= "z":
        small = True
    else:
        small = False
        break

if a == True and c == True and small == True:
    print("AC")
else:
    print("WA")

Solution (Python):
s = input()

LETTERS_A = "BCDEFGHIJKLMNOPQRSTUVWXYZ"
LETTERS_C = "ABDEFGHIJKLMNOPQRSTUVWXYZ"
LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
count = 0
is_ok = True
c1, c2 = False, False
for i in range(len(s)):
    if i == 0:
        c1 = (s[i] == "A")
        if s[i] in LETTERS_A:
            is_ok = False
    elif (2 <= i) and (i <= len(s)-2):
        if s[i] == "C":
            count += 1
        if s[i] in LETTERS_C:
            is_ok = False
    elif s[i] in LETTERS:
        is_ok = False
        
c2 = (count == 1)
if c1 and c2 and is_ok:
    print("AC")
else:
    print("WA")

Solution (Python):
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")

Solution (Python):
s = list(input())
j= 2
count = 0
if not s[0] == 'A':
    print('WA')
    exit()

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

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

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

print('WA')

Solution (Python):
s = list(input())
if s[0] == "A" and "C" in s[2:-1]:
    s.remove("A")
    s.remove("C")
    for i in s:
        if i.isupper():
            print("WA")
            exit()
    print("AC")
else:
    print("WA")

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

Solution (Python):
s=input()

n = len(s)

countC = 0

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

for i in range(n):
    
    if i == 0 and s[i] != 'A':
        print('WA')
        exit()
    elif i == 0 and s[i] == 'A':
        continue
    elif s[i] == 'C' and 1 < i and i < n-1:
        countC += 1
    elif s[i] in alf:
        continue
    else:
        print('WA')
        exit()
    
if countC == 1:
    print('AC')
else:
    print('WA')

Solution (Python):
s=input()
S=list(s)
cc=0
for i in range(2,len(S)-1):
  if S[i]=='C':
    cc=cc+1
if cc>=1:
  S.remove('C')
S.remove(S[0])
count=[]
if s[0]=='A':
  count.append(1)
if cc==1:
  count.append(2)
if ''.join(S).islower():
  count.append(3)

if count==[1,2,3]:
  print('AC')
else:
  print('WA')

Solution (Python):
n=input()
count=0
for i in range(len(n)):
    if i==0:
        if n[i]=='A':
            continue
        else:
            print('WA')
            exit()

    elif i==1 or i==len(n)-1:
        if n[i].islower():
            continue
        else:
            print('WA')
            exit()

    else:
        if n[i]=='C':
            count+=1
            if count>=2:
                print('WA')
                exit()
        elif n[i].islower():
            continue
        else:
            print('WA')
            exit()

if count==1:
    print('AC')
else:
    print('WA')

Solution (Python):
s = input()

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

Solution (Python):
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")

Solution (Python):
S = input()

ans = "AC"

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

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

T = S[1:].replace("C","c",1)

if not T.islower() :
    ans = "WA"

print(ans)

Solution (Python):
S = input()
flag1 = False
if S[0] == "A":
    S=S.replace("A","",1)
    if "C" in S[1:-1]:
        S = S.replace("C", "", 1)
        if S.islower():
            print("AC")
        else:
            print("WA")
    else:
            print("WA")
else:
            print("WA")

Solution (Python):
S = input()
flag = True
C_cnt = 0
for i in range(len(S)):
    if i==0:
        if S[i]!="A":
            flag = False
            break
    elif i>=2 and i<len(S)-1:
        if S[i]=="C":
            C_cnt += 1
        elif ord(S[i]) < 97 or ord(S[i]) > 122:
            flag = False
            break
    else:
        if ord(S[i]) < 97 or ord(S[i]) > 122:
            flag = False
            break
if flag==True and C_cnt==1:
    print("AC")
else:
    print("WA")

Solution (Python):


def isValid(target:str):
    if target[0] != "A":
        return False
    if target.count("A") != 1:
        return False
    if target.count("C") != 1:
        return False
    if target[2:len(target)-1].count("C") != 1:
        return False
    for i in target:
        if i == "A":
            continue
        if i == "C":
            continue
        if "a" <= i <= "z":
            continue
        return False
    return True

if isValid(input().rstrip()):
    print("AC")
else:
    print("WA")

Solution (Python):

import sys


S_list=list(input().strip())
sub_S = S_list[2:-1]

if S_list[0] != "A"  or  sub_S.count("C") != 1:
    print("WA")
    sys.exit()

check_S = S_list[:]
del check_S[ 2 + sub_S.index("C") ]
del check_S[0]

if ("".join(check_S)).islower():
    print("AC")
else:
    print("WA")
    sys.exit()

Solution (Python):

import sys


S_list=list(input().strip())
sub_S = S_list[2:-1]

if S_list[0] != "A"  or  sub_S.count("C") != 1:
    print("WA")
    sys.exit()

check_S = S_list[:]
del check_S[ 2 + sub_S.index("C") ]
del check_S[0]

for word in check_S:
    if "a" <= word <= "z":
        continue
    else:
        print("WA")
        sys.exit()

print("AC")

Solution (Python):
S = input()
f = True
if S[0] != 'A':
  f = False
elif S[2:-1].count('C') != 1:
  f = False
else:
  for s in S[1:]:
    if s not in 'Cabcdefghijklmnopqrstuvwxyz':
      f = False
      break
print('AC' if f else 'WA')

Solution (Python):
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')

Solution (Python):
def is_u(c):
    return c == c.upper()
S = input()
a = S[0] == "A"
b = S[2:-1].count("C") == 1
c = sum([int(is_u(c)) for c in S]) == 2

if a and b and c:
    print("AC")
else:
    print("WA")

Solution (Python):
s = str(input())
C_count = 0
a = 0
b = 0
c = 0
k = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
if s[0] == "A":
  a += 1
for i in s[2:-1]:
  if i == "C":
    C_count += 1
if C_count == 1:
  b += 1

l = s[1:]
l = l.replace("C","")
if l.islower() == True:
  c += 1
if a == 1 and b == 1 and c == 1:
  print("AC")
else:
  print("WA")

Solution (Python):
s = str(input())
flag = 0
C_count = 0
flag_2 = 0
mode = 0
a = 0
b = 0
c = 0
k = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
if s[0] == "A":
  a += 1
for i in s[2:-1]:
  if i == "C":
    C_count += 1
if C_count == 1:
  b += 1

l = s[1:]
l = l.replace("C","")
if l.islower() == True:
  c += 1
if a == 1 and b == 1 and c == 1:
  print("AC")
else:
  print("WA")

Solution (Python):
S = str(input())

a=0
b=0
c=0
if S[0]=='A':
    a=1

cnt=0
for i in S[2:-1]:
    if i=='C':
        cnt+=1
if cnt==1:
    b=1

s=S[1:]
s=s.replace('C','')
if s.islower()==True:
    c=1

if a==1 and b==1 and c==1:
    print('AC')
else:
    print('WA')

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

Solution (Python):
s = list(input())



ans = True
if s[0] != "A":
    print("WA")
elif s[2:-1].count("C") != 1:
    print("WA")
else:
    s.remove("A")
    s.remove("C")
    if not str(s).islower():
        print("WA")
    else:
        print("AC")

Solution (Python):
s = input()
if s[0]=="A":
    checker = 0
    for i in range(2, len(s)-1):
        if s[i] =="C":
            checker += 1
    if checker == 1:
        checker = 0
        for i in range(len(s)):
            if ord(s[i])<97:
                checker += 1
        if checker == 2:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    flg=1
    s=STR()
    n=len(s)
    c=0
    if s[0]=='A' and 'C' in s[2:n-1]:
        if s.count('C')==1:
            c=s.index('C')
        else:
            flg=0
    else:
        flg=0
    
    for i in range(n):
        if i==0 or i==c:
            pass
        else:
            if s[i].islower():
                pass
            else:
                flg=0
    if flg==1:
        print('AC')
    else:
        print('WA')
    
if __name__ == '__main__':
    do()

Solution (Python):
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])

Solution (Python):
S = input()
cond1 = S[0] == 'A'
cond2 = S.count('C', 2, -1) == 1
cond3 = S[1:].replace('C', '', 1).islower()
flag = cond1 * cond2 * cond3
print('WAC'[flag:][:2])

Solution (Python):
import re
print("AC" if re.match("^A[a-z]+C[a-z]+$",input()) else "WA")

Solution (Python):
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')

Solution (Python):
S=list(input())

abc=set([chr(ord('A')+i) for i in range(26)])

if S[0]=='A':
    cnt=0
    ind=0
    for i in range(2,len(S)-1):
        if S[i]=='C':
            cnt+=1
            ind=i
    if cnt==1:
        del S[ind]
        del S[0]
        for s in S:
            if s in abc:
                print('WA')
                exit()
        print('AC')
        exit()
print('WA')

Solution (Python):
S = input()
OK = False







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')

Solution (Python):
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")

Solution (Python):
S = input()

ans = "AC"

w = "BDEFGHIJKLMNOPQRSTUVWXYZ"
cnt = 0
for i, s in enumerate(S):
    if i == 0:
        if s != "A":
            ans = "WA"
            break
    elif 2 <= i <= len(S) - 2:
        if s == "C":
            cnt += 1
        elif s in w:
            ans = "WA"
            break
    else:
        if s in w:
            ans = "WA"
            break
if cnt != 1:
    ans = "WA"

print(ans)

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

Solution (Python):
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")

Solution (Python):
def resolve():
	s=input()
	if s.count('A')!=1 or s.count('C')!=1 or s[0]!='A':
		print('WA')
	elif 'C' not in s or s.index('C')<2 or s[-1]=='C':
		print('WA')
	elif s.replace('A','').replace('C','')!=(s.replace('A','').replace('C','')).lower():
		print('WA')
	else:
		print('AC')
resolve()

Solution (Python):
s = input()

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

Solution (Python):
S = input()
if S[0] == 'A' and S[2:-1].count('C') == 1:
    index = S.index('C')
    s = S[1:index] + S[index+1:]
    if s.islower():
        print('AC')
        exit()
print('WA')

Solution (Python):
s = list(input())
if (s[0] == "A") and (s[2:-1].count("C")==1):
    s[0] = "a"
    s[s[2:-1].index("C")+2] = "c"
    l = list()
    for i in range(len(s)):
        l.append(s[i].lower())
    
    if s == l:
        print("AC")
        exit()
print("WA")

Solution (Python):

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)

Solution (Python):

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

Solution (Python):

S=input()
S_upper=S.upper()
flg= S[0]=='A' and S[2:-1].count('C')==1 and S.count('A')==1 and S.count('C')==1 and set(S)&set(S_upper)=={'A','C'}
print('AC' if flg else 'WA')

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

Solution (Python):
s = input()
cnt = 0
if s[0] == 'A' and s[1].islower() and s[-1].islower():
    for i in range(len(s)-3):
        if s[i+2] == 'C':
            cnt += 1
        elif s[i+2].islower():
            continue
        else:
            cnt = None
            break
if cnt == 1:
    print('AC')
else:
    print('WA')

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

Solution (Python):
S = input()

c_count = 0
if S[0] == 'A' and S[1].islower() and S[-1].islower():
    for s in S[2:-1]:
        if s == 'C':
            c_count+=1
        elif s.islower():
            continue
        else:
            c_count = None
            break

if c_count == 1:
    print('AC')
else:
    print('WA')

Solution (Python):
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')

Solution (Python):
s=input()
print("AC" if "C" in s[2:-1] and "A" in s and s[1:].replace("C","",1).islower() else "WA")

Solution (Python):
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)

Solution (Python):
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")