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 = input()
up_ctr = 0
if s[0] != 'A':
    print('WA')
else:
    if s[2:len(s)-1].count('C') != 1:
        print('WA')
    else:
        for i in range(1, len(s)):
            if s[i].isupper():
                up_ctr += 1
        if up_ctr != 1:
            print('WA')
        else:
            print('AC')

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

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

Solution (Python):
s = input()

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

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

Solution (Python):
def abc104_b():
    s = input()
    num = s.find("C")
    if s[0] == "A" and s[2:-1].count("C") == 1 and (s[1:num] + s[num + 1:]) == (s[1:num] + s[num + 1:]).lower():
        print("AC")
    else:
        print("WA")


abc104_b()

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

Solution (Python):
S = input()
ans = 'AC'
if S[0] != 'A' or S[2:-1].count('C') != 1:
    ans = 'WA'
else:
    for i in range(len(S)):
        if i == 0:
            continue
        elif (2 <= i <= len(S)-2) and S[i] == 'C':
            continue
        else:
            if not ('a' <= S[i] <= 'z'):
                ans = 'WA'
                break
print(ans)

Solution (Python):
import sys
word = input()
if ((word[0] == 'A') & (word[2:-1].count('C') == 1)):
  word = word.replace("A","")
  word = word.replace("C","")
  if (word.islower()):
    print('AC')
  else:
    print('WA')
else:
  print('WA')

Solution (Python):
import re

S = input()
matchObj = re.match(r'^A[a-z]+C{1}[a-z]*[a-z]$', S)
if matchObj:
    print('AC')
else:
    print('WA')

Solution (Python):
s = input()
c1, c2, c3 = False, False, False

import re


if s[0] == "A":
  c1 = True
if s[2:-1].find("C") >= 0:
  c2 = True
if len(re.findall("[a-z]", s)) == len(s)-2:
  c3 = True



if c1 and c2 and c3:
  print("AC")
else:
  print("WA")

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

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

Solution (Python):
def main():
    s = list(input())
    s_len = len(s)
    if s[0] != "A":
        print("WA")
        return
    elif s[1] == "C":
        print("WA")
        return
    elif s[s_len-1] == "C":
        print("WA")
        return
    c_counter = 0

    for i in range(2, s_len - 1):
        if(s[i] == "C"):
            if(c_counter == 1):
                print("WA")
                return
            c_counter += 1
    for i in range(s_len):
        if(s[i].isupper()):
            if(s[i] != "A" and s[i] != "C"):
                print("WA")
                return
    if(c_counter == 0):
        print("WA")
        return

    print("AC")
main()

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

flag=0


if ord(s[0])==65 and 65+32<=ord(s[1])<=90+32 and 65+32<=ord(s[-1])<=90+32:
  flag=1
  for i in range(2,len(s)-1):
    if ord(s[i])==67:
      flag+=1
  
print('AC' if flag==2 else 'WA')

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

flag=0
cnt1=0
cnt2=0
if ord(s[0])==65 and 65+32<=ord(s[1])<=90+32 and 65+32<=ord(s[-1])<=90+32:
  flag=1
  for i in range(2,len(s)-1):
    if ord(s[i])==67:
      flag+=1
  
print('AC' if flag==2 else 'WA')

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

Solution (Python):
s = input()

c1, c2 = False, False

if s[0] == 'A':
    c1 = True

if s[2:-1].count('C') == 1:
    c2 = True

s_lower = s[1:].replace('C', 'c')
c3 = s_lower.islower()

if c1 and c2 and c3:
    print('AC')
else:
    print('WA')

Solution (Python):
S = input()

mid = S[2:-1]
C_count = 0

for i in mid:
    if i == 'C':
        C_count += 1
        
S_lower = S.lower()
S_replace = S.replace('A', 'a').replace('C', 'c')
        
if S[0] == 'A' and C_count == 1 and S_lower == S_replace:
    print('AC')
else:
    print('WA')

Solution (Python):
s=input()
x=len(s)
d='abcdefghijklmnopqrstuvwxyz'
sum=0
count=0
ans='WA'
if s[0]=='A':
  for i in range(2,x-1):
    if s[i]=='C':
      sum+=1
  if sum==1:
    for i in range(1,x):
      for j in range(26):
        if s[i]==d[j]:
          count+=1
    if count==x-2:
      ans='AC'
print(ans)

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

Solution (Python):


import re


def solve():
    S = input()

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

    print('WA')


if __name__ == '__main__':
    solve()

Solution (Python):
def main() :
	S = input()
	if (S[0] != "A") :
		print("WA")
		return
	
	if (list(S).count("A") != 1) :
		print("WA")
		return
	
	S2 = list(S[2:-1])
	if (S2.count("C") != 1) :
		print("WA")
		return
	
	for s in list(S) :
		if (s == "A" or s == "C") :
			continue
		
		if (s.isupper()) :
			print("WA")
			return
	
	print("AC")


main()

Solution (Python):


def ac(S):
    if S[0] != "A":
        return False
    C = S.find("C")
    if C <= 1 or C == len(S)-1:
        return False
    for c in (S[1:C] + S[C+1:]):
        if c.isupper():
            return False
    return True


def main():
    S = input()
    if ac(S):
        print("AC")
    else:
        print("WA")


if __name__ == "__main__":
    main()

Solution (Python):
S = input()

count = 0
ans = True

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

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

Solution (Python):
S = input()

ans = True

if(S[0] != "A"):
    ans = False
if not "C" in S[2:-1]:
    ans = False
count = 0
for c in S:
    if c.isupper():
        count += 1

if count > 2:
    ans = False

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

Solution (Python):
from collections import Counter

def is_lower_case(c):
  lower_case_alphabets = 'abcdefghijklmnopqrstuvwxyz'
  return c in lower_case_alphabets

S = input()
cnt = Counter(S[2:-1])

flag = True
if S[0] != 'A':
  flag = False
if cnt['C'] != 1:
  flag = False
for c in S[1:]:
  if c != 'C' and not is_lower_case(c):
    flag = False
print('AC' if flag else 'WA')

Solution (Python):
def main():
    s = input()

    if s[0] != "A" or s[1].isupper() or s[-1].isupper():
        print("WA")
        return

    num_c = 0
    num_cap = 0
    for l in s[2:-1]:
        if l == "C":
            num_c += 1
        if l.isupper():
            num_cap += 1
    if num_c == 1 and num_cap == 1:
        print("AC")
    else:
        print("WA")

if __name__ == "__main__":
    main()

Solution (Python):
S = input()
S_len = len(S)
S_list = list(S)
fin_S = ''


if S_list[0] == 'A':
    S_list[0] = 'a'
    
    if 'C' in S[2:S_len-1]:
        C_index = S.index('C')
        
        if 2 <= C_index < S_len-1:
            S_list[C_index] = 'c'
            for i in range(S_len):
                fin_S+=S_list[i]
                

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

print('WA')

Solution (Python):
from collections import Counter

s = input()

flag = 1
if not s[0] == "A":
    flag = 0

c = Counter(s[2:-1])
if not c["C"] == 1:
    flag = 0

small = set([chr(i) for i in range(ord("a"), ord("z") + 1)])

for i, w in enumerate(s):
    if (i == 1 or i == len(s)-1) and not(w in small):
        flag = 0

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

Solution (Python):
T = []
for i in range(ord("a"),ord("z")+1) :
    T.append(chr(i))

L = list(input())
counter = 0
flag = 0
for i in range(len(L)) :
    if i == 0 :
        if L[i] != "A" :
            ans = -1
            break
    elif i == 1 :
        if L[i] not in T :
            counter += 1
    elif 2 <= i <= len(L)-2 :
        if L[i] not in T and flag == 1 :
            counter += 1
        elif flag == 0 and L[i] == "C" :
            flag = 1
    else :
        if L[i] not in T :
            counter += 1
if counter > 0 or flag == 0 :
    print("WA")
else :
    print("AC")

Solution (Python):
S = input()

if S[0] == "A" and "C" in [str(a) for a in S[2:-1]]:
    t = 0
    for a in S:
        if a.isupper():
            t += 1
    if t == 2:
        print("AC")
        exit(0)
print("WA")

Solution (Python):
s = str(input())
if s[0] != "A":
    print("WA")
    exit()
cou = 0
for i in range(1,len(s)):
    num = ord(s[i])-ord("a")
    if 0 <= num and num <= 25:
        continue
    else:
        if s[i] == "C":
            if i == 1 or i == len(s)-1:
                print("WA")
                exit()
            else:
                cou += 1
        else:
            print("WA")
            exit()
if cou == 1:
    print("AC")
else:
    print("WA")

Solution (Python):
import sys
stdin = sys.stdin

sys.setrecursionlimit(10**5)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

def judge(s:list) -> bool:
    
    if not s[0] == 'A':
        return False
        
    if not 'C' in s[2:-1]:
        return False
        
    s.remove('C')
    s.remove('A')
    
    for si in s:
        if not 'a' <= si <= 'z':
            return False
            
        
    return True


s = lc()

ac = judge(s)
print('AC') if ac else print('WA')

Solution (Python):
S = input()
def ok(s):
    if s[0] != 'A':
        return False
    elif s[2:-1].count('C') != 1:
        return False
    upper = 0
    for c in s:
        if c.isupper():
            upper += 1
    if upper != 2:
        return False
    return True

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

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

Solution (Python):
S=input()
n=len(S)
if S[0]=="A":
	if 2<=S.find("C")<=n-2:
		T=S.lstrip("A")
		R=T.replace("C","c",1)
		Q=T.replace("C","c")
		if R==Q:
			if R.lower()==R:
				print("AC")
				exit()
print("WA")

Solution (Python):
s=input()
flg = False
if s[0] != 'A':
    flg = True
if s[2:-1].count('C')!=1:
    flg = True
if s[1:].replace('C','') != s[1:].replace('C','').lower():
    flg = True
print(['AC','WA'][flg])

Solution (Python):
import sys
N = list(input())
komoji = 0
oomoji = 0
if N[0] == 'A':
    if N[1].islower():
        for i in range(2, len(N)-1):
            if N[i] == 'C':
                oomoji += 1
            if N[i].islower():
                komoji += 1
        if N[-1].islower():
            komoji += 1
if oomoji == 1 and komoji == len(N) - 3:
    print("AC")
else:
    print("WA")

Solution (Python):
s = input()
n = len(s)
c = False
for e,i in enumerate(s):
    if e == 0:
        if not i == "A":
            print("WA")
            break
    elif 1 < e < n-1 and i == "C":
        if not c:
            c = True
        else:
            print("WA")
            break
    else:
        if not i in "abcdefghijklmnopqrstuvwxyz":
            print("WA")
            break
else:
    if c:
        print("AC")
    else:
        print("WA")

Solution (Python):
import re


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

Solution (Python):
S = input()

if S[0] != 'A' or not 'C' in S[2:-1] or not S[1].islower() or not S[-1].islower():
    print('WA')
    exit()
n = 1
for i in S[2:-1]:
    if i.islower():
        pass
    elif i == 'C' and n==1:
        n-=1
    else:
        print('WA')
        exit()
print('AC')

Solution (Python):
import re

S = input()

def main():
    m = re.match(r'^A[a-z](?P<mid>[a-zC]+)[a-z]$', S)
    if m is None:
        ans = "WA"
    else:
        mid = m.group("mid")
        if mid.count("C") == 1:
            ans = "AC"
        else:
            ans = "WA"
    print(ans)

if __name__ == "__main__":
    main()

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

Solution (Python):
a = list(input())
b = "BDEFGHIJKLMNOPQRSTUVWXYZ"
c = list(b)

if a.count("A") != 1 or a.count("C")!= 1:
  print("WA")
elif a.index("A") == 0 and a.index("C") >= 2 and a.index("C") <= (len(a)-2):
  for i in range(len(a)):
    if a[i] in c:
      print("WA")
      break
  else:
    print("AC")
else:
  print("WA")

Solution (Python):
s = input()
ans = 'AC'
if s[0] == 'A' and (s[1]+s[-1]).islower() == True:
    ss = list(s[2:-1])
    cnt = 0
    for t in ss:
        if t == 'C':
            cnt += 1
        elif t.islower() == False:
            ans = 'WA'
    if cnt != 1:
        ans = 'WA'
else:
    ans = 'WA'
print(ans)

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

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

Solution (Python):
s = input()
d1 = False
d2 = False
d3 = False
if s[0] == 'A':
    d1 = True
cnt = 0
for i in range(2, len(s)-1):
    if s[i] == 'C':
        cnt += 1
if cnt == 1:
    d2 = True
cnt2 = 0
for j in range(len(s)):
    if s[j].islower():
        cnt2 += 1
if cnt2 == len(s) - 2:
    d3 = True
print('AC' if d1 and d2 and d3 else 'WA')

Solution (Python):

s = input()
sub_s = s[2:-1]


res = s[0] == "A"
if res:
    
    res = sub_s.count("C") == 1
    if res:
        index = sub_s.index("C") + 2
        
        res = s[1:index].islower() and s[index+1:].islower()


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

Solution (Python):
import sys
s=input()
if(s[0]!="A"):
    print("WA")
    sys.exit(0)
if(s[1].isupper()):
    print("WA")
    sys.exit(0)
flag=0
for i in range(2,len(s)-1):
    if(s[i].isupper()):
        flag+=1
        if(flag>=2 or s[i]!="C"):
            print("WA")
            sys.exit(0)
if(s[len(s)-1].isupper() or flag!=1):
    print("WA")
else:
    print("AC")

Solution (Python):
import re

def main():
    s = input()
    if check(s):
        print('AC')
    else:
        print('WA')

def check(s):
    pat = re.compile(r'A[a-z][a-z]*C[a-z]*[a-z]')
    m = pat.fullmatch(s)
    return bool(m)

main()

Solution (Python):
s = input()
t = list(s)
x = 0
y = 0
z = 0
r = []

if t[0] == "A":
  x = 1
  
r.append(t[1])
r.append(t[len(t) - 1])

for i in range(2,len(t) - 1): 
  if t[i] == "C":
    y += 1
  else:
    r.append(t[i])

for j in r:
  if j.isupper():
    z = 1

if x == 1 and y == 1 and z == 0:
  print("AC")
else:
  print("WA")

Solution (Python):
s=input()
c=0
if s[0]!='A' or s[0].isupper()==False:
  print("WA")
else:
  for i in range(2,len(s)-1):
    if s[i]=='C' and s[i].isupper()==True:
      c+=1
  if c==1 and s[1].isupper()==False and s[len(s)-1].isupper()==False:
    print("AC")
  else:
    print("WA")

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def solve(S):
    if S[0] != "A":
        return "WA"
    if S[2:-1].count("C") != 1:
        return "WA"
    for c in S:
        if c != "A" and c != "C":
            if str(c).isupper():
                return "WA"
    return "AC"


def main():
    S = input()

    print(solve(S))


if __name__ == '__main__':
    main()

Solution (Python):
S = input()

ans = 'AC'
c = 0

for i, s in enumerate(S):
    if i == 0:
        if s != 'A':
            ans = 'WA'
    elif i == 1:
        if s.isupper():
            ans = 'WA'
    elif i > 1 and i < len(S) - 1:
        if s == 'C':
            c += 1
        elif s.isupper():
            ans = 'WA'
    else:
        if s.isupper():
            ans = 'WA'

if c != 1:
    ans = 'WA'

print(ans)

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

Solution (Python):
S=input()
if S[0]=='A' and S.count('C', 2, len(S)-1)==1:
  L = list(S)
  del L[S.find('C', 2, len(S)-1)]
  del L[0]
  for i in L:
    if i.isupper() is True:
      A = 'WA'
      break
    else:
      A = 'AC'
  print(A)
else:
  print('WA')

Solution (Python):
from sys import stdin


def main() -> None:
    s = next_str()
    print(("WA", "AC")[judge(s)])


def judge(s: str) -> bool:
    flg = False
    n = len(s)

    for i in range(n):
        if i == 0:
            if s[i] != 'A':
                return False
        elif 2 <= i < n - 1 and s[i] == 'C' and not flg:
            flg = True
        elif s[i] != s[i].lower():
            return False

    if not flg:
        return False
    return True


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

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

def conditionA(s_list):
    return s[0] == "A"

def conditionC(s_list):
    return "C" in s_list[2:-1]

def conditionLower(s_list):
    return sum([e.isupper() for e in s_list]) == 2

if conditionA(s) and conditionC(s) and conditionLower(s):
    print("AC")
else:
    print("WA")

Solution (Python):
a=input()
c=0
if a[0]=="A":
    for x in a[2:-1]:
        if (x == "C"):
            c += 1
    if c == 1:
        a= a.replace("C","")
        a= a.replace("A","")
        if a.islower():
            print("AC")
        else :
            print("WA")
    else :
        print("WA")
else :
    print ("WA")

Solution (Python):
import string

def accepted(s):
    if s[0] != 'A':
        return "WA"
    if s[1] == 'C':
        return "WA"
    if s[-1] == 'C':
        return "WA"
    c = 0
    for ss in s[1:]:
        if ss == 'C':
            c += 1
        elif ss not in string.ascii_lowercase:
            return "WA"
    if c != 1:
        return "WA"
    return "AC"

s = input()
print(accepted(s))

Solution (Python):
S = input()

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

Solution (Python):
S = input()

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

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

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

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

Solution (Python):
S = input()

def f(S):
    if S.startswith('A'):
        if S[2:-1].count('C') == 1:
            hantei = S[1] + S[2:-2].replace('C', 'c') + S[-1]
            if hantei.islower():
                return 'AC'
    return 'WA'

print(f(S))

Solution (Python):
s = input()
count = 0
for i in range(len(s)):
    
    if i == 0:
        if s[i] != 'A':
            break
    
    elif s[i].isupper():
        
        if 2 <= i < len(s) - 1 and s[i] == 'C':
            count += 1
        
        else:
            count = 0
            break

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

Solution (Python):
s = input()
count = 0
for i in range(len(s)):
    
    if i == 0:
        if s[i] != 'A':
            break
    
    elif s[i].isupper():
        
        if 2 <= i < len(s) - 1 and s[i] == 'C':
            count += 1
        
        else:
            count = 0
            break

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

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

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

Solution (Python):
S = input()
k = 0
if S[0] == 'A' and S[2:-1].count('C') == 1:
    for i in range(len(S)):
        if S[i].isupper():
            if k == 2:
                print('WA')
                exit()
            k += 1
    print('AC')
else:
    print('WA')

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

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

Solution (Python):
import sys
import string
s=input()
if s[0]!='A':
  print('WA')
  sys.exit()
elif s[1] in string.ascii_uppercase or s[-1] in string.ascii_uppercase:
  print('WA')
  sys.exit()
else:
  c=0
  for i in s[2:-1]:
    if i in string.ascii_uppercase:c+=1
  if c!=1:
    print('WA')
    sys.exit()
  print('AC')

Solution (Python):


s = input()

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

Solution (Python):
s = input()
ans = 0
if s[0] == 'A':
    ans += 1
cnum = 0
for i in range(2,len(s)-1):
    if s[i] == 'C':
        cnum += 1
if cnum == 1:
    ans += 1
hantei = 0
for i in range(len(s)):
    if s[i].islower():
        pass
    else:
        hantei += 1
if hantei == 2:
    ans += 1
if ans == 3:
    print('AC')
else:
    print('WA')

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

Solution (Python):
S = input()
if S[0] == "A":
    if "C" in S[2:-1] and S[2:-1].find("C") == S[2:-1].rfind("C"):
        S = S.replace("A","a",1)
        S = S.replace("C","c",1)
        if S == S.lower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
from collections import Counter
S = list(input())

if S[0] == 'A':
    if S[2:-1].count('C') == 1:
        idx = S[2:-1].index('C')
        del S[idx+2]
        del S[0]
        s = ''.join(S)
        if s.islower():
            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:
  i = s.index("C")
  ss = s[1:i] + s[i+1:]
  if ss.islower() == True:
    print("AC")
  else:
    print("WA")
else:
  print("WA")

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

Solution (Python):
S=input()
t= [str(c) for c in S]
flag=0

if t[0]!="A":
    flag=1
b=0
i=0

for i in range(2,len(t)-1):
    if t[i]=="C":
        b += 1
if b!=1:
    flag=1

i=0
for i in range(len(t)):
    if t[i]=="A" or t[i]=="C" :
        continue
    elif ord(t[i])>90:
        continue
    else:
        flag=1
        break

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

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

def isA(strlist):
    if strlist[0] == 'A':
        return True

def isC1(strlist):
    if strlist[2:-1].count('C') == 1:
        return True

def issmall(strlist):
    strlist = strlist[2:-1] + [strlist[1]] + [strlist[-1]]
    strlist.remove('C')
    string = ''.join(strlist)
    if string.islower():
        return True


if isA(string) and isC1(string) and issmall(string):
    print('AC')
else:
    print('WA')

Solution (Python):
S = input()

def f(S):
    if S[0] is not "A":
        return(False)
    if not "C" in S[2:-1]:
        return(False)
    if [str.isupper(c) for c in S].count(True) != 2:
        return(False)
    return(True)

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

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

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

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

n = s.index('C')
t = []

for i in range(len(s)):
    if i != 0 and i != n:
        t.append(s[i])

tt = ''.join(t)

if tt.islower():
    print("AC")

else:
    print("WA")

Solution (Python):
word = input()

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

result="AC"
ccount = 0
for i, c in enumerate(word[1:], 1):
    if c.islower():
        continue
    if c == 'C' and i > 1 and i < len(word) - 1:
        ccount += 1
        continue
    result = "WA"
    break
if ccount != 1:
    result = "WA"
print(result)

Solution (Python):
S = input()
S2 = S.replace("A","")
S3 = S2.replace("C","")

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

Solution (Python):
s = input()
c = s.find('C', 2, len(s) - 1)

if s.startswith('A') and \
   s.count('C', 2, len(s) - 1) == 1 \
   and (s[1:c] + s[c+1:]).islower():
    print('AC')
else:
    print('WA')

Solution (Python):


INF = float('inf')


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


S = input()
ans = 'AC'
if S[0] != 'A': ans = 'WA'

cnt = 0
for s in S[2:-1]:
    if s == 'C':
        cnt += 1
    else:
        if s.isupper():
            ans = 'WA'

if cnt != 1: ans = 'WA'
if S[-1].isupper(): ans = 'WA'
if S[1].isupper(): ans = 'WA'
print(ans)

Solution (Python):
S = input()
flag = True
if S[0] != "A":
    flag = False
C = 0
bi = 0
for i in range(len(S)):
    if 2 <= i < len(S) - 1:
        if S[i] == "C":
            C += 1
    if S[i].upper() == S[i]:
        bi += 1

if bi != 2:
    flag = False

if C != 1:
    flag = False

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

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

Solution (Python):
s = list(input())
if s[0] == "A":
  C = []
  for i in range(2, len(s)-1):
    if s[i] == "C":
      C.append(i)
  if len(C) != 1:
    print("WA")
  else:
    up = False
    for j in range(1,len(s)):
      if j == C[0]:
        continue
      elif not s[j].islower():
        up = True
    if up:
      print("WA")
    else:
      print("AC")
else:
  print("WA")

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

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

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

count = 0
for i in range(1,len(s)):
  if s[i] == "C" and 2<= i and i<=len(s)-2:
    count += 1
  elif s[i].isupper():
     print("WA")
     exit()

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

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

if S[0] != 'A' or R.count('C') != 1 or not T.islower():
    print("WA")
else:
    print("AC")

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")
	else:
		print("WA")	
else:
	print("WA")

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

flag = True
if s[0] != "A":
    flag = False

ss = s[2:-1]
if ss.count("C") != 1:
    flag = False
for si in s:
    if si != "A" and si != "C":
        if si.islower() != True: 
            flag = False
            
print("AC" if flag else "WA")

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

if s[0] == "A":
    if s[2:-1].count("C") == 1:
        s.remove("C")
        if "".join(s[1:]) == "".join(s[1:]).lower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
s=list(input())
n=len(s)
if s[0]!='A':print('WA')
else:
  c=0
  for i in range(2,n-1):
    if s[i]=='C':c+=1
  if c!=1:print('WA')
  else:
    s.remove('A')
    s.remove('C')
    t=''.join(s)
    u=t.lower()
    if t==u:print('AC')
    else:print('WA')