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):
a=input()
ans="AC"
if not a[0]=="A":
  ans="WA"
if not a[2:-1].count("C")==1:
  ans="WA"
a=a.replace("A","",1).replace("C","",1)
if not a.islower():
  ans="WA"
print(ans)

Solution (Python):

S = input()
flag1, flag2, flag3 = False, False, False
if S[0] == "A":
    flag1 = True
    if "C" in S[2:-1] and S[2:-1].count("C") == 1:
        flag2 = True
        cnt = 0
        AC_cnt = 0
        for i in range(len(S)):
            if S[i] == S[i].lower() and S[i] != "A" and S[i] != "C":
                cnt += 1
            elif S[i] == "A" or S[i] == "C":
                AC_cnt += 1
        if cnt + AC_cnt == len(S):
                flag3 = True
print("AC" if flag1 and flag2 and flag3 else "WA")

Solution (Python):
S = input()

ans = True
if S[0] != "A":
    ans = False
if S[2:-1].count("C") != 1:
    ans = False
if len([x for x in S if x.islower()]) != len(S) - 2:
    ans = False

print("AC" if ans else "WA")

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

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

Solution (Python):
s=list(input())
if s[0]!="A":
    print("WA")
elif s[2:-1].count("C")!=1:
    print("WA")
else:
    s.pop(0)
    s.remove("C")
    if "".join(s).lower()!="".join(s):
        print("WA")
    else:
        print("AC")

Solution (Python):
from collections import deque
S=input()
can=True
kazu=0
for i in range(len(S)):
    s=S[i]
    if i==0:
        if s!="A":
            can=False
        continue
    if 2<=i<=len(S)-2:
        if s=="C":
            kazu+=1
            continue
    if s.isupper():
        can=False
if kazu!=1:
    can=False
if can:
    print("AC")
else:
    print("WA")

Solution (Python):
s=input();ans="AC"
for i in range(len(s)):
  if s[i]<="Z" and "A"!=s[i]!="C":ans="WA"
if s[0]!="A":ans="WA"
s=s[1:]
if "C"in s[0]+s[-1]:ans="WA"
s=s[1:-1]
if not"C"in s:ans="WA"
n=s.find("C");s=s[:n]+s[n+1:]
if "C"in s:ans="WA"
print(ans)

Solution (Python):
s = input()
ans = "WA"
tmp =""
if s[0] == 'A':
    if s[2:-1].count("C") ==1:
        tmp = s.replace("A","a").replace("C","c")
        if tmp == s.lower():
            ans = "AC"
print(ans)

Solution (Python):
S = input()

if S[0] == "A":
  if S[2:-1].count('C') == 1:
    index_c = S.find("C")
    S = S[1:index_c] + S[index_c+1:]
    if S.islower():
      print("AC")
    else:
      print("WA")
  else:
    print("WA")
else:
  print("WA")

Solution (Python):
S = input()

ans = False

if S[0] == "A":
    if S[2:-1].count("C") == 1:
        S2 = S.replace("C", "c")
        if S2[1:].islower():
            ans = True

if ans:
    print("AC")
else:
    print("WA")

Solution (Python):
s = input()

ans = True
if s[0] is not "A":
  ans = False
if s[1] is "C" or s[-1] is "C":
  ans = False
if "C" not in s:
  ans = False
if s.count("C") > 1 or s.count("A") > 1:
  ans = False
for c in s:
  if c is not "A" and c is not "C" and c.isupper():
    ans = False

if ans == True:
  print("AC")
else:
  print("WA")

Solution (Python):

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

Solution (Python):
s = list(input())
if s[0] == "A":
    if s[2:-1].count("C") == 1:
        s.remove("C")
        del s[0]
        a = str(s)
        if a.islower():
            print("AC")
            exit()
print("WA")

Solution (Python):
from sys import stdin
s = stdin.readline().rstrip()
if s[2:-1].count('C') == 1:
    ic = s[2:-1].index('C')+2
    if ic>len(s):
      ic=len(s)-1
    if s[0]=='A' and (s[1:ic]+s[ic+1:]).islower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Solution (Python):

import sys

def main():
	S = input()
	S = list(S)
	
	if S[0] != "A":
		print("WA")
		sys.exit()
		
	tmp = S[2:-1]
	p = -1
	flg = False
	for i, val in enumerate(tmp):
		if val == "C":
			flg = True
			p = i + 2
	if flg == False:
		print("WA")
		sys.exit()
		
	for i, val in enumerate(S):
		if i == 0 or i == p:
			continue
		if val.islower() == False:
			print("WA")
			sys.exit()
	
	print("AC")
		
if __name__ == "__main__":
	main()

Solution (Python):
S = input()

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

Solution (Python):
large=list("BDEFGHIJKLMNOPQRSTUVWXYZ")
small=list("abcdefghijklmnopqrstuvwxyz")
s=list(input())
if s[0]!="A" or s.count("A")!=1:
  print("WA")
  exit()
t=s[2:len(s)-1]
if t.count("C")!=1:
  print("WA")
  exit()
for i in s:
  if i in large:
    print("WA")
    exit()
print("AC")

Solution (Python):
s=str(input())
if s[0]=="A":
    if s[2:-1].count("C")==1:
        a=s.lstrip("A").replace("C","")
        if a==a.lower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
str=list(input())
flag=True
if str[0]!='A':
    flag=False
str[0]='a'
cnt=0
for i in range(2,len(str)-1):
    if str[i]=='C':
        cnt+=1
        if cnt==1:
            str[i]='c'
if cnt!=1:
    flag=False

tmp="".join(str)
if not tmp.islower():
    flag=False

if flag==True:
    print("AC")
else:
    print("WA")

Solution (Python):
import string

alp = string.ascii_uppercase

def main():
    S = input()
    len_s = len(S)

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

    for i in range(2, len_s-1):
        if S[i] == 'C':
            c_index = i
            break
        if i == len_s-2:
            print ('WA')
            return

    for i in range(1, len_s):
        if i == c_index:
            continue
        if S[i] in alp:
            print ('WA')
            return

    print ('AC')

main()

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

Solution (Python):
s = raw_input()
if s[0] != 'A':
	print 'WA'
else:
	if s[-1] != 'A' and s[-1] != 'C' and not s[-1].islower():
		print 'WA'
	elif s[1] != 'A' and s[1] != 'C' and not s[1].islower():
		print 'WA'
	else:
		ss = s[2:-1]
		c = 0
		flag = True
		for sss in ss:
			if sss == 'C':
				c += 1
			else:
				if sss != 'A' and not sss.islower():
					flag = False
					break
		if c != 1:
			flag = False
		if flag:
			print 'AC'
		else:
			print 'WA'

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

Solution (Python):
def a(s) :
	if s[0] != 'A':
		return 'WA'
	count = 0
	for w in s[2:-1]:
		if w =='C':
			count += 1
	if count != 1:
		return 'WA'
	for w in s:
		if w != 'A' and w != 'C' and w.isupper() :
			return'WA'
	return 'AC'
print a(raw_input())

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 = list(input())
S_len = len(S)
S_mid = list(S[2:S_len-1])
S_head = S[0]
del S[2:S_len-1]
del S[0]
if S_head == "A":
    if S_mid.count("C") == 1:
        S = "".join(S)
        if S.islower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
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):
import re; print('AC' if re.match(r'^A[a-z]+C[a-z]+$', input()) else 'WA');

Solution (Python):
S = input()
N = len(S)
flag = False

for i, charS in enumerate(S):
    if charS == "C" and (1 < i and i < N-1):
        flag = True
        numC = i
        break

if S[0] != "A":
    flag = False

if flag:
    text = [S[j] for j in range(N) if j != 0 and j != numC]
    text = ''.join(text)
    if not(text.islower()):
        flag = False

print("AC" if flag else "WA")

Solution (Python):
S=input()
c=0
if S[0]=="A" and "C" in S[2:len(S)-1]:
  i=S.find("C")
  S=S[1:i]+S[i+1:]
  if S.islower():
    c=1
print("AC" if c==1 else "WA")

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

Solution (Python):
s = input()
S = sorted(s)
print("AC" if s[0]=="A" and s[2:-1].count("C")==1 and "Z"<S[2] else "WA")

Solution (Python):
S = input()

if S[0] == "A":
    if S[2:-1].count("C") == 1:
        Ssorted = sorted(S)
        if "Z" < Ssorted[2]:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
s = input()

if s[0] == 'A':
    index = s.find('C', 2, -1)
    s = s[:index] + s[index + 1:]
    if index > 0:
        if s[1:].islower():
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print("WA")

Solution (Python):
S = input()

count = 0

if S[0] == 'A' and S[0].isupper():
    count = count + 1

num_loop = len(S) - 3
count_ = 2
c_num = 0
for i in range(num_loop):
    if S[count_] == 'C' and S[count_].isupper():
        c_num = c_num + 1
    count_ = count_ + 1
if c_num == 1:
    count = count + 1


if count == 2:
    up_count = 0
    for i in range(len(S)):
        if S[i].islower():
            continue
        else:
            up_count = up_count + 1

    if up_count == 2:
        count = count + 1

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

Solution (Python):
s = list(str(input()))
res = 'AC'
if(s[0] != 'A') : res = 'WA'
if(s[2:len(s)-1].count('C') != 1 ) : res = 'WA'
if('A' in s) : s.remove('A')
if('C' in s) : s.remove('C')
for i in range(len(s)) :
  if(s[i].isupper()) : res = 'WA'
print(res)

Solution (Python):
s=input()
if s[0]!='A':
    print('WA')
else:
    count=0
    for i in range(2,len(s)-1):
        if s[i]=='C':
            count+=1
    if count!=1:
        print('WA')
    else:
        a=list(s)
        a.remove('A')
        a.remove('C')
        b=''.join(a)
        if b.islower():
            print('AC')
        else:
            print('WA')

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

Solution (Python):
S = input()
T = S[2:-1]
X = S.replace('A','a').replace('C','c')

if S[0] == 'A' and T.count('C') == 1 and X.lower() == X:
    print("AC")
else:
    print("WA")

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

Solution (Python):
S = input()

def hasC(txt):
    c = 0
    for t in txt:
        if t == "C":
            if c > 0:
                return False
            c = 1
    return c == 1
def allLower(txt):
    a = ord("a")
    z = ord("z")
    for t in txt:
        tc = ord(t)
        if tc < a or tc > z:
            return False
    return True

if S[0] != "A":
    print("WA")
    exit()
if not hasC(S[2:-1]):
    print("WA")
    exit()
nonC = S[:2] + S[2:-1].replace("C", "") + S[-1]
if not allLower(nonC[1:]):
    print("WA")
    exit()
print("AC")

Solution (Python):
import re

r = input()
if r.startswith("A"):
  if len(re.findall("C",r[2:-1])) == 1:
    r = r[1:2]+r[2:-1].replace("C","")+r[-1]
    if r.islower():
      print("AC")
    else:
      print("WA")
  else:
    print("WA")
else:
  print("WA")

Solution (Python):
S = list(input())
AC = True
if S[0] != "A" or S.count("C") != 1 or not 2 <= S.index("C") <= len(S)-2:
    AC = False
else:
    count = 0
    for i in range(1, len(S)):
        if "A" < S[i] < "Z":
            count += 1
            if count == 2:
                AC = False

if AC:
    print("AC")
else:
    print("WA")

Solution (Python):
S = list(input())
AC = True
if S[0] != "A" or S.count("C") != 1 or not 2 <= S.index("C") <= len(S)-2:
    AC = False
else:
    count = 0
    for i in range(1, len(S)):
        if "A" < S[i] < "Z":
            count += 1
            if count == 2:
                AC = False

if AC:
    print("AC")
else:
    print("WA")

Solution (Python):
ans=0
count=0
s=input()
if s[0]=="A":
        ans+=1
cut=s[2:-1]
if cut.count("C")==1:
        ans+=1
cap=["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(len(s)):
        if s[i] in cap:
                count+=1
if count==2:
        ans+=1
if ans==3:
        print("AC")
else:
        print("WA")

Solution (Python):
S = str(input())
flag = False
count = 0
tmp_str = ""
if S.count("C") == 1 and S[0] == "A":
  flag = True
  for i in range(1,len(S),1):
    if S[i] == "C":
      count = i
    else:
      tmp_str += S[i]

if (flag == True) and (count > 1) and (count < len(S)-1) and (tmp_str.islower() == True):
  print("AC")
else:
  print("WA")

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

if S[0] == 'A':
    count_C = 0
    for ind in range(3-1, len(S)-1):
        if S[ind] == 'C':
            ind_C = ind
            count_C += 1
    if count_C == 1:
        del S[0]
        del S[ind_C - 1]
        s = 'a'
        for i in S:
            s = s + i
        if s.islower():
            print('AC')
            exit()
print('WA')

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

Solution (Python):
s = input()

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

if s[1].isupper() or s[-1].isupper():
    print("WA")
    exit()

count = 0
for s_ in s[2:]:
    if s_.isupper():
        if s_ == "C":
            count += 1
        else:
            print("WA")
            exit()
        

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

Solution (Python):
S = list(input())
judge = 1 
C_count = 0
C_index = 0

if(S[0] != 'A'):
  print('WA')
  
else: 
 for i in range(len(S)):
  if(i != 0):
   if(S[i] == 'C'):
     C_count += 1
     C_index = i
   else:
     if(S[i] != S[i].lower()):
       judge = 0
      
 if(C_count != 1):
   judge = 0
 else:
  if( (C_index < 2)or((len(S)-2) < C_index) ):
    judge = 0
 
 if(judge == 1):
    print('AC')
 else:
    print('WA')

Solution (Python):







import re
r = re.compile(r'^A[a-z]+C[a-z]+$')
msg = ['WA','AC']
print(msg[len(r.findall(str(input())))])

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

Solution (Python):
S = input()

def isLowerWithoutAC(s):
    l = list(s)
    l.remove('A')
    l.remove('C')
    return ''.join(l).islower()

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

Solution (Python):
s=input()
character=["q","w","e","r","t","y","u","i","o","p","l","k","j","h","g","f","d","s","a","z","x","c","v","b","n","m"]
flag=0
for i in range(len(s)):
    if i==0:
        if s[i]!="A":
            print("WA")
            exit()
    elif 2<=i<=len(s)-2:
        if flag==1 and s[i]=="C":
            print("WA")
            exit()
        elif flag==0 and s[i]=="C":
            flag=1
        elif flag==0 and not s[i] in character:
            print("WA")
            exit()
        elif flag==1 and not s[i] in character:
            print("WA")
            exit()
    else:
        if not s[i] in character:
            print("WA")
            exit()
if flag==0:
    print("WA")
    exit()
print("AC")

Solution (Python):

S = input()
ans = 'WA'
if S[0] == 'A':
  if 'C' in S[2:-1]:
    c = 0
    for s in S:
      if ord(s) < 97:
        c += 1
    if c == 2:
      ans = 'AC'
print(ans)

Solution (Python):
def accepted(S: str)->bool:
    if S[0] != 'A':
        return False
    if sum(1 for c in S[2:-1] if c == 'C') != 1:
        return False

    sorted_s = ''.join(sorted(S)[2:])
    return sorted_s == sorted_s.lower()


if __name__ == "__main__":
    S = input()
    ac = accepted(S)
    print('AC' if ac else 'WA')

Solution (Python):
S=input()
if S[0]=='A' and 'C' in S[2:-1] 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')

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

Solution (Python):
s = input()
t = s.replace('A','c').replace('C','c')
if s[0]!='A' or 'C' not in s[2:len(s)-1] or s[2:len(s)-1].count('C') != 1 or t != t.lower():
    print('WA')
else:
    print('AC')

Solution (Python):
def solve(string):
    is_a = string[0] == "A"
    index_c = string.find("C")
    rest = string[1:index_c] + string[index_c + 1:]
    return "AC" if is_a and 1 < index_c < len(string) -1 and rest == rest.lower() else "WA"


if __name__ == '__main__':
    print(solve(input()))

Solution (Python):
S=input()

def solve():
  temp=0
  if S[0]!='A':
    print('WA')
    return
  if not 'a'<=S[1]<='z':
    print('WA')
    return
  for i in range(2,len(S)-1):
    if S[i]=='C':
      temp+=1
      if temp>1:
        print('WA')
        return
  if temp==0:
    print('WA')
    return
    
  if not 'a'<=S[len(S)-1]<='z':
    print('WA')
    return
  
  print('AC')

solve()

Solution (Python):
S = input()
flag = True
if S[0] != "A":
    flag = False
S = S[1:]
idx = S.find("C")
if idx not in range(1, len(S) - 1):
    flag = False
if idx >= 0:
    S = S[:idx] + S[idx+1:]
if not S.islower():
    flag = False
print("AC") if flag else print("WA")

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

Solution (Python):
S = input()
if S[0] != 'A':
  print("WA")
else:
  if 'C' not in S[2:-1] or S[2:-1].count('C') > 1:
    print("WA")
  else:
    i = S.find('C')
    S = S[0:1].lower() + S[1:i] + S[i:i+1].lower() + S[i+1:]
    if S.islower():
      print("AC")
    else:
      print("WA")

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

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

Solution (Python):
S = list(input())
if S[0] == "A" and S[2:-1].count("C") == 1:
    S.remove("A")
    S.remove("C")
    count = 0
    for i in range(len(S)):
        if S[i].islower():
            count += 1
    if count == len(S):
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
s=list(input())
def C(s):
    if s[0]!='A':
        return False
    if 'C' in s:
        i=s.index('C')
        if 2<=i<=len(s)-2:
            k=s.pop(i)
            l=s.pop(0)
            if ''.join(s).islower():
                return True
            
    return False
if (C(s)):
    print('AC')
else:
    print('WA')

Solution (Python):
import re

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

Solution (Python):
S = input()
if S[0] == "A" and S[2:-1].count("C") == 1 and "C" in S[2:-1]:
    s = S.replace("A", "a").replace("C", "c")
    t = s.lower();
    if s == t:
        print("AC")
        exit()
print("WA")

Solution (Python):
S = input()

def func(s):
    if s[0] == 'A':
        if s[2:-1].count('C') == 1:
            s_ = s[2:-1].replace('C', '')
            ss = s[1] + s_ + s[-1]
            return ss.islower()
        else:
            return False
    else:
        return False

if func(S):
    print('AC')
else:
    print('WA')

Solution (Python):
def solve():
    S = input()
    if S[0] != 'A':
        return False
    if S[2:-1].count('C') != 1:
        return False
    n = len(list(filter(lambda c:'a' <= c and c <= 'z', S)))
    if n != len(S) - 2:
        return False
    return True

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

Solution (Python):
S = input()
flg = True
if 'C' in S[2:len(S) - 1]:
    i = S.index('C')
else:
    i = -1

if S[0] == 'A' and i != -1:
    others = S[1:i] + S[i + 1:]
    for o in others:
        if not (ord('a') <= ord(o) <= ord('z')):
            flg = False
            break
else:
    flg = False

print('AC' if flg else 'WA')

Solution (Python):


import sys
import numpy as np


def solve(s):
  if s[0] != 'A':
    return False
  if s[2:-1].count('C') != 1:
    return False
  s = s[1:]
  s = s[:-1].replace("C", "") + s[-1]
  for c in s:
    if c not in 'abcdefghijklmnopqrstuvwxyz':
      return False
  return True

s = str(input())
if solve(s):
  print('AC')
else:
  print('WA')

Solution (Python):
S = input()
count_C = 0
index_C = 0
if S[0] == 'A':
  for i in range(2,len(S)-1):
    if S[i] == 'C':
      count_C+=1
      index_C = i
  if count_C == 1:
    s = S[1:index_C]+S[index_C+1:]
    if s.islower():
      print('AC')
    else:
      print('WA') 
  else:
    print('WA') 
else:
  print('WA')

Solution (Python):
s = input()
ans = "AC"

if s[0] != 'A':
    ans = "WA"
if s[2:-1].count('C') != 1:
    ans = "WA"
cnt = 0
for c in s[1:]:
    if c.isupper():
        cnt += 1
if cnt != 1:
    ans = "WA"
print(ans)

Solution (Python):
s = list(input())
c = 0
if s[0] != "A":
    print("WA")
    
else:
    for a in s[2:-1]:
        if a == "C":
            c += 1
            t = a
    if c == 1:
        s.remove(s[0])
        s.remove(t)
        if "".join(s).islower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")

Solution (Python):
S = [i for i in input()]
if S[0]=="A" and S[2:-1].count("C")==1:
    S.remove("A")
    S.remove("C")
    if "".join(S).islower():
            print("AC")
    else:
        print("WA")
else: 
    print("WA")

Solution (Python):

s = input()
if s[0] != "A":
    print("WA")
    exit()
if (s[2:len(s) - 1].count("C") != 1):
    print("WA")
    exit()
if (len(s) - len([b for b in s if b.islower()]) != 2):
    print("WA")
    exit()
print("AC")

Solution (Python):
S = input()
if S[0]!='A':
  print('WA')
else:
  i = 2
  count = 0
  while i < len(S)-1:
  	if S[i] == 'C':
      		count += 1
  	i += 1
  if count != 1:
    print('WA')
  else:
    S = S.replace('A','').replace('C','')
    if S.islower() == False:
      print('WA')
    else:
      print('AC')

Solution (Python):
import collections
s=list(map(str,input()))
if s[0]=="A":
    c=collections.Counter(s[2:-1])
    if c["C"]==1:
        s.remove("A")
        s.remove("C")
        s=map(str,s)
        s="".join(s)
        if s.islower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
S=input()
A=0
if S[0]=='A':
  for i in range(2,len(S)-1):
    if S[i]=='C':
      A+=1
      B=i
  if A==1:
    S=S[1:B]+S[B+1:]
    if S.islower():
      print('AC')
    else:
      print('WA')
  else:
    print('WA')
else:
  print('WA')

Solution (Python):
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 s[i]!= "C" or i==len(s)-1:
            ans = "WA"
        cnt+=1
if cnt!=1:
    ans="WA"
print(ans)

Solution (Python):
def islow(a):
    if 97 <= ord(a) < 123:
        return 1
    return 0

s = input()
t = 0
if s[0] == "A":
    t += 1
for i in range(1, len(s)):
    if 2<=i<=len(s)-2 and s[i] == "C":
        t += 10
    elif not islow(s[i]):
        t += 100
    
print("AC" if t == 11 else "WA")

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

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

Solution (Python):
sml = list("qwertyuiopasdfghjklzxcvbnm")
big = list("QWERTYUIOPASDFGHJKLZXCVBNM")

s = list(input())

if s[0] != "A" or s[1] in big or s[-1] in big:
  print("WA")
else:
  bigc = s[2:-1]
  cnt_c = 0
  cnt_big = 0
  for item in bigc:
    if item == "C":
      cnt_c += 1
    elif item in big:
      cnt_big += 1
  if cnt_c == 1 and cnt_big == 0:
    print("AC")
  else:
    print("WA")

Solution (Python):
S = input()

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

print('WA')

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

Solution (Python):
s = input()
judge = True
alphabet_1 = "ABCDEFGHIJKMLNOPQRSTUVWXYZ"
alphabet_2 = "ABDEFGHIJKMLNOPQRSTUVWXYZ"
count = 0
if s[0] != "A":
    judge = False
for i in range(1,len(s)):
    if i >1 and i<=len(s)-2:
        if s[i] == "C" : count+=1
        for j in alphabet_2:
            if j == s[i] : 
                judge=False
                break
    else:
        for j in alphabet_1:
            if j == s[i]:
                judge=False
                break
if count !=1 : judge = False
print("AC") if judge else print("WA")

Solution (Python):

hoge=input()
no=0

if(hoge[0]=="A"):
    hoge=hoge.replace("A","a",1)
else:
    no=1
    
if not(hoge[1].islower() and hoge[-1].islower()):
    no=1

if(hoge.count("C")==1):
    hoge=hoge.replace("C","c",1)
else:
    no=1
    
if(hoge.islower() and no==0):
    print("AC")
else:
    print("WA")

Solution (Python):
S = input()
flag1 = 0
flag2 = 0
flag3 = 0

if not ('A' in S and 'C' in S):
	print('WA')
	exit() 

if S[0] == 'A':
	flag1 = 1

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

S_list = list(S)
S_list.remove('A')
S_list.remove('C')
if str(S_list).islower():
	flag3 = 1

if flag1 == 1 and flag2 == 1 and flag3 == 1:
	print('AC')
else:
	print('WA')

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


if __name__ == "__main__":
    main()

Solution (Python):
N = input()
c = 0
for i, n in enumerate(N):
    if i == 0:
        if not n == "A":
            print("WA")
            exit()
    elif n == 'C':
        if 2<= i and i < len(N) -1:
            c += 1
    else:
        if not 97 <= ord(n) or not ord(n) <= 122:
            print("WA")
            exit()
if c == 1:
    print("AC")
else:
    print("WA")

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

Solution (Python):
import re

S = str(input())
answer = 'WA'

if S[0] == 'A':
	if S.count('C') == 1:
		if 1< S.find('C') < len(S)-1:
			if len(re.findall('[A-Z]',S)) ==2:
				answer = 'AC'
				
print(answer)

Solution (Python):
s = input()
n = len(s)

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

for i in range(n):
    if s[i] == "C":
        s1 = s[1:i] + s[i+1:]

if s1.islower():
    print("AC")
else:
    print("WA")
    exit()

Solution (Python):
s=input()
import re
if (s[0] == 'A') and ('C' in s[2:-1]) and (re.sub('A|C','',s,2) == re.sub('A|C','',s,2).lower()):
  print('AC')
else:
  print('WA')

Solution (Python):



def main():
    S = input()
    if S[0] == "A" and S[2:-1].count("C") == 1:
        S = S.replace('A', '', 1).replace('C', '', 1)
        if all(c.islower() for c in S):
            print("AC")
            exit()

    print("WA")


if __name__ == '__main__':
    main()

Solution (Python):

"""
Created on Tue Feb 12 15:50:41 2019

@author: shinjisu
"""


import math


def getInt(): return int(input())


def getIntList(): return [int(x) for x in input().split()]


def zeros(n): return [0]*n


def getIntLines(n): return [int(input()) for i in range(n)]


def getIntMat(n):
    mat = []
    for i in range(n):
        mat.append(getIntList())
    return mat


def dmp(x):
    global debug
    if debug:
        print(x)
    return x



def abc100b():
    D, N = getIntList()
    if N % 100 == 0:
        return (N+1) * 100**D  
    else:
        return N * 100**D



def abc101b():
    N = getInt()
    sm = 0
    n = N
    while n > 0:
        sm += n % 10
        n //= 10
    if N % sm == 0:
        return 'Yes'
    else:
        return 'No'



def abc102b():
    N = getInt()
    A = getIntList()
    return max(A) - min(A)



def abc104b():
    S = input()
    WA = 'WA'
    AC = 'AC'
    ALPHABET = [chr(i+ord('a')) for i in range(26)]
    dmp(ALPHABET)

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

    cFound = False
    for i in range(1, len(S)):
        if S[i] in ALPHABET:
            pass
        elif S[i] == 'C':
            if i >= 2 and i <= len(S)-2 and not cFound:
                cFound = True
            else:
                dmp(('C',WA))
                return WA
        else:
            dmp(('alpha',WA))
            return WA
    else:
        if cFound:
            return AC
        else:
            return WA


debug = False  
print(abc104b())

Solution (Python):
S=str(input())
slist=list(S)
flag=0
if slist[0]!="A":
  flag=1
klist=slist[2:-1]
c=klist.count("C")
if c!=1:
  flag=1
del slist[0]
if "C" in slist:
  slist.remove("C")
SS=""
for x in slist:
  SS+=x
if SS.islower():
  pass
else:
  flag=1
if flag==0:
  print("AC")
else:
  print("WA")

Solution (Python):
S = input()
S2 = S
ans = 'WA'
if S[0] == 'A' and S[2:-1].count('C') == 1 and S[0].replace('A', 'a') + S[1] + S[2:-1].replace('C', 'c') + S[-1] == S2.lower():
    ans = 'AC'
print(ans)