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):
def main():
    s=input()
    if s[0] == "A":
        if (s[2:-1:]).count("C") == 1:
            for i in s[1:]:
                c = False
                if i == "C" and not c:
                    c = True
                    continue
                elif i == "C" and c:
                    break
                elif i.islower():
                    continue
                else:
                    break
            else:
                print("AC")
                return
    print("WA")
    
if __name__ == "__main__":
    main()

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






if __name__ == "__main__":
    solve()

Solution (Python):
import math
def main():
  s = input()
  flg=0
  if s[0]=='A':
    if s[2:len(s)-1].count('C')==1:
      s=s.replace('C','c')
      if s[1:].islower():
        print("AC")
        flg=1
  if flg==0:
    print("WA")
main()

Solution (Python):
import sys
def LS2(): return list(sys.stdin.readline().rstrip())  

S = LS2()

if not (S.count('C') == 1 and S[0] == 'A' and S[1] != 'C' and S[-1] != 'C'):
    print('WA')
    exit()
else:
    for i in range(1,len(S)):
        if not (S[i] == 'C' or S[i].islower()):
            print('WA')
            exit()
print('AC')

Solution (Python):
import sys
s = input()

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

if s[2:len(s)-1].count("C") != 1:
  answer = False
  
for i in range(len(s)):
  if s[i] != "A" and s[i] != "C":
    if ord(s[i]) < 97  or  122 < ord(s[i]):
      answer = False

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

Solution (Python):
s=input()
n=len(s)
f=True
if s[0]!='A':
    f=False
if s[2:n-1].count('C')!=1:
    f=False
for ss in s:
    if ss!='A' and ss!='C' and ss.isupper():
        f=False
print('AC' if f else 'WA')

Solution (Python):
S = input()
N = len(S)
f = True
if S[0] != 'A':
    f = False
if S[2:N-1].count('C') != 1:
    f = False
for s in S:
    if s != 'A' and s != 'C' and s.isupper():
        f = False
print('AC' if f else 'WA')

Solution (Python):
S = input()
ans = 0

if S[0]=="A":
  S = S[1:]
  if 1<=S.find("C")<=len(S)-2:
    S = S[:S.find("C")]+S[S.find("C")+1:]
    for s in S:
      if 97<=ord(s)<=122:
        ans+=1
    if ans == len(S):
      print("AC")
      exit()
        
print("WA")

Solution (Python):
S = list(input())
l = [chr(i) for i in range(65, 65+26)]

flag = True
count = 0
for i in range(len(S)):
    if i == 0:
        if S[i] != 'A':
            flag = False
            break
    if i == 1:
        if S[i] in l:
            flag = False
            break
    if 2 <= i <= len(S) - 2:
        if S[i] == 'C':
            count += 1
        elif S[i] in l:
            flag = False
            break
    if i == len(S) - 1:
        if S[i] in l:
            flag = False
            break
if not count == 1:
    flag = False

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

Solution (Python):
import string

s = list(input())
flag = True
if s[0] != "A":
    flag = False
count = 0
for i in range(1, len(s)):
    if s[i] in string.ascii_uppercase:
        if i == 1 or i == len(s) - 1 or s[i] != "C":
            flag = False
        count += 1

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

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

Solution (Python):


def solve(s):
    return s[0] == "A" and s.count("C",2,-1) == 1 and s[1:].replace("C", "").islower()


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

if __name__ == '__main__':
    main()

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

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

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

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

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

print("AC")

Solution (Python):
s = input()

cond = True

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

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

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

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

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

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

Solution (Python):
s=list(input())
if s[0]=="A" and s[2:len(s)-1].count("C")==1:
    s[0]="a"
    s[s.index("C")]="c"
    if "".join(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:
    for i in range(len(s)):
        if not (i == 0 or i == s[2:-1].index('C')+2):
            if not s[i].islower():
                print('WA')
                exit()
    print('AC')
    exit()
print('WA')

Solution (Python):
s = input()
n = len(s)
ans = 1
if s[0] != "A":
    ans *= 0
if not (97 <= ord(s[1]) <= 122):
    ans *= 0
if not (97 <= ord(s[-1]) <= 122):
    ans *= 0

check = 0
for i in range(1, n - 1):
    if s[i] == "C":
        check += 1
print(["WA", "AC"][ans & (check == 1)])

Solution (Python):

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

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

S = list(input().rstrip('\n'))

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

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

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

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

Solution (Python):
import sys
S = input()

if S[0] is 'A' and S[2:-1].count('C') == 1:
    if S[-1] != 'C' and S[:2].count('C') == 0:
        S = S.replace('C', '')
        S = S[1:]
        for i in S:
            if i.islower():
                continue
            else:
                print('WA')
                sys.exit()
        print('AC')
else:
    print('WA')

Solution (Python):
s = input()

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

print(ans)

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

s = rr()
if s[0] != 'A':
  print('WA')
  exit()
if 'C' in s[2:-1] and s.count('C') == 1:
  for i in s.replace('A', '').replace('C', ''):
    if 97 <= ord(i) <= 122:
      continue
    else:
      print('WA')
      exit()
  else:
    print('AC')
else:
  print('WA')

Solution (Python):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0
inf = float("inf")

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

Solution (Python):
s=input()
ans=0
count=0
t=""
if s[0]=="A":
  ans+=1
for i in range(2,len(s)-1):
  
  if s[i]=="C":
    count+=1
    t=s[1:i]+s[i+1:]	

if t.islower()==True and ans==1 and count==1:
  print("AC")
else:
  print("WA")

Solution (Python):

import sys
from collections import deque, defaultdict
from math import sqrt, factorial





def solve():
    s = input()
    t = s[:]
    a = [x for x in s.lower()]
    i = s.find('A')
    j = s.find('C')
    if i != -1 and j > 1 and j < len(s) - 1 and s.count('C') == 1:
        a[i] = 'A'
        a[j] = 'C'
        s = ''.join(a)
        if s == t:
            print("AC")
            exit()

    print("WA")


t = 1

for case in range(1,t+1):
    ans = solve()




"""

4
1 2
2 4
1 3
3
2 2 4
4 5 6

6
1 2
2 3
3 4
4 5
4 6
3
3 5 6
2 17 31 5 11

"""

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

Solution (Python):
import re

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

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

Solution (Python):
import sys
import re
S = input()
array_S = list(S)

if not ( 4 <= len(S) <= 10 ):
    print('WA')
    sys.exit()
if len(re.findall('[A-Z]',S)) != 2:
    print('WA')
    sys.exit()

result = 0
if array_S[0] != 'A': result += 1
if array_S[2:-1].count('C') != 1: result += 1 
array_S.pop(0)
array_S.pop(array_S.index('C'))
if not "".join(array_S).islower(): result += 1 
print('WA') if result != 0 else print('AC')

Solution (Python):
import re
s = input()
pattern = 'A[a-z]+C[a-z]+'

result = re.fullmatch(pattern, s)


if result == None:
    print('WA')
else:
    print('AC')

Solution (Python):
s = input()

if s[0] != "A":
  print("WA")
  exit()
if s[2:-1].count("C") != 1:
  print("WA")
  exit()
t = s.index("C")
if s[1:t].islower() == False or s[t+1:].islower() == False:
  print("WA")
  exit()
print("AC")

Solution (Python):
s = input()
length = len(s)
count = 0
count_large = 0
sep = s[2:length-1]


if s[0] == 'A':
    count += 1

if sep.count('C') == 1:
    count += 1

for i in range(length):
    if s[i].isupper():
        count_large += 1
        
if count_large == 2:
    count += 1

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

Solution (Python):
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

s = s()

flag = 0
if s[0] == "A":
	flag += 1 
cnt1 = 0
for i in range(2,len(s)-1):
	if s[i] == "C":
		cnt1 += 1
if cnt1 == 1:
	flag += 1
cnt2 = 0
for i in range(1,len(s)):
	if s[i].islower():
		cnt2 += 1
if cnt2 >= len(s) -2:
	flag += 1

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

Solution (Python):
s = input()

f = True
if s[0] != 'A':
    f = False
else:
    cnt=0
    for _s in s[2:-1]:
        if _s == 'C':
            cnt+=1
    if cnt!=1:
        f = False
    else:
        cnt = 0
        for _s in s:
            if _s.isupper():
                cnt+=1
        if cnt>2:
            f = False
if f:
    print('AC')
else:
    print('WA')

Solution (Python):
s=input()
ans='AC'
if s[0]!='A':
  ans='WA'
s=s[1:]
if s[1:-1].count('C')!=1:
  ans='WA'
s=s.replace('C','c')
for i in s:
  if i.islower()==False:
    ans='WA'
    break
print(ans)

Solution (Python):
S=list(map(lambda x:x,input()))

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

if F:
    S.remove("A")
    S.remove("C")
    for s in S:
        F&=(s==s.lower())
if F:
    print("AC")
else:
    print("WA")

Solution (Python):
s=input()
ans=0
if s[0]!='A':
    print("WA")
    exit()
for i in range(1,int(len(s))):
    if s[i].isupper():
        if i==1 or i==int(len(s))-1 or s[i]!='C':
            print("WA")
            exit()
        ans+=1
if ans !=1:
    print("WA")
    exit()
print("AC")

Solution (Python):
s = input()
ans = 'WA'
if s[0] == 'A' and s[2:len(s)-1].count('C') == 1:
  s = s.replace('A', '').replace('C', '')
  if all([i in [chr(i) for i in range(97, 97+26)] for i in s]):
    ans = 'AC'
print(ans)

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

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

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

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

print("WA")

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

def has_A(x):
    if x[0] == 'A': return True
    return False


def has_C(x):
    if x[2:-1].count('C') == 1: return True
    return False


def is_lower_this_case(x):
    i = x.index('C')
    if x[1:i].islower() and x[i+1:].islower():
        return True
    return False

if has_A(s) and has_C(s) and is_lower_this_case(s):
    print('AC')
else:
    print('WA')

Solution (Python):
s = input()
flg = 1
if (s[0] != 'A'):
    flg = 0
cnt = 0
for i in s[2:-1]:
    if (i == 'C'): cnt+= 1
if (cnt != 1):
    flg = 0 

cap = 0
for i in s:
    if ('A' <= i <= 'Z'): cap += 1
if (cap != 2):
    flg = 0
if (flg): print("AC")
else: print("WA")

Solution (Python):
s = input()
ans = "AC"
if s[0] == "A":
  c_cnt = 0
  for i in range(2,len(s)-1):
    if s[i] == "C":
      c_cnt += 1
  if c_cnt == 1:
    for i in s:
      if i.lower() != "a" and i.lower() != "c" and i.lower() != i:
        ans = "WA"
        break
  else:
    ans = "WA"
else:
  ans = "WA"
print(ans)

Solution (Python):
s = input()

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

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

if a[0]!='A' or 'C' not in a[2:-1]:
    print('WA')
    exit()
a.remove('A')
a.remove('C')
n=''.join(a)
if n.islower()==False:
    print('WA')
    exit()
print('AC')

Solution (Python):
s = list(input())
ans = "WA"

if s[0] == "A":
    if s[2:-1].count("C") == 1:
        s.remove("C")
        k = "".join(s[1:])
        if k.islower():
            ans = "AC"
print(ans)

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

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

def word_check(S):
    for s in S:
        if s.isupper():
            if s not in ["A", "C"]:
                return "WA"
    if S[0] == "A":
        if S[1] not in ["A", "C"] and S[-1] not in ["A", "C"]:
            count_C = 0
            for s in S[2: -1]:
                if s == "C":
                    count_C += 1
            if count_C == 1:
                return "AC"
    return "WA"

print(word_check(S))

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

Solution (Python):
S = input()
if S[0]=="A" and S[2:-1].count("C")==1:
    b = 0
    for s in S:
        if not 97<=ord(s)<=122:
            b += 1
    if b==2:
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
def resolve():
    S = input()
    if S[0] == "A" and S[2:-1].count("C") == 1:
        if S.count("A") == 1 and S.count("C") == 1:
            S = S.replace("A", "").replace("C", "")
            if S == S.lower():
                print("AC")
                return
    print("WA")


resolve()

Solution (Python):
s = input()
def WA():
  print('WA')
  exit()
if s[0] != 'A':
  WA()
if ord(s[-1]) < ord('a') or ord('z') < ord(s[-1]):
  WA()
if ord(s[1]) < ord('a') or ord('z') < ord(s[1]):
  WA()
s = s[1:]
ccnt = 0
for i in s[1:-1]:
  if i == 'C':
    ccnt += 1
  elif ord(i) < ord('a') or ord('z') < ord(i):
    print('WA')
    exit()
if ccnt != 1:
  print('WA')
  exit()
else:
  print('AC')

Solution (Python):
def actual(s):
    
    cond1 = s[0] == 'A'

    
    cond2 = s[2:-1].count('C') == 1

    
    cond3 = all([char.islower() for char in s if char != 'A' and char != 'C'])

    if cond1 and cond2 and cond3:
        return 'AC'

    return 'WA'

s = input()
print(actual(s))

Solution (Python):
import sys
s = str(input())

if s[0] != 'A':
    print('WA')
    sys.exit()
    
test_st = s[2:-1]

test_stx =''
for i in range(len(test_st)):
    if test_st[i] == 'C':
        test_stx = s[1]+test_st[:i] + test_st[i+1:]+s[-1]
        
    
if test_stx.islower() and len(test_stx) >0:
    print('AC')
else:
    print('WA')

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

Solution (Python):
S = input()

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

print("WA")

Solution (Python):
S = input()

if S[0] == "A":
    T = S[2:-1]
    flag = 0
    ok = -1
    for i in T:
        if i == "C" and flag ==0:
            ok = T.index("C")
            flag = 1
        elif i == "C" and flag == 1:
            ok = -1
            break
    if ok >= 0:
        H = S[1:]
        F = H[:ok+1] + H[ok+2:]
        t = False
        for k in F:
            if k.isupper():
                t = True
        if not t:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
S=input()
p='AC'
o=0
u=0
for i in range(len(S)):
  if i==0 and S[i]!='A':
    p='WA'
    break
  if 2<=i<=len(S)-2:
    if S[i]=='C':
      o+=1
  if len(S)-2<i and o!=1:
    p='WA'
    break
  if ord(S[i])<97:
    if i==0 or 2<=i<=len(S)-2:
      continue
    else:
      p='WA'
      break
print(p)

Solution (Python):
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy

def main():
    s = input()
    flag = False
    count = 0
    
    for i in range(len(s)):
        if s[i].isupper():
            count += 1

    if count > 2:
        print("WA")
        sys.exit()
    count = 0
    for i in range(len(s)):
        if (i == 0 and s[i] == "A"):
            flag = True
        
        if (2 <= i < len(s)-1):
            if (s[i] == "C"):
                count += 1


    if count != 1:
        flag = False

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

if __name__ == "__main__":
    main()

Solution (Python):
import sys
S = list(input())
C_cnt,low,upp = 0,0,0
if S[0] != "A" or S[-1].isupper() or S[1].isupper():
  print("WA")
  sys.exit()
for i in range(2,len(S)-1):
  if S[i] == "C":
    C_cnt += 1
  elif S[i].islower():
    low += 1
  elif S[i].isupper():
    upp += 1
if C_cnt == 1 and low == len(S)-4 and upp == 0:
  print("AC")
else :
  print("WA")

Solution (Python):


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

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

for s in S:
    if s.islower() == False:
        ans = 'WA'
        break

print(ans)

Solution (Python):
S=input()
chk = [False, False, False]
if S[0]=="A":
    chk[0]=True

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

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

if chk[0] and chk[1] and chk[2]:
    print("AC")
else:
    print("WA")

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

print("WA")

Solution (Python):
s = input()

flg = 0

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

t  = s[2:-1]


if t.count("C") == 1:
    flg = 1
else:
    print("WA")
    exit()

s=s.replace("A", "")
s =s.replace("C", "")


if s.islower():
    print("AC")
else:
    print("WA")

Solution (Python):
S = input()

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

print("WA")

Solution (Python):
s = input()
n = len(s)
ok = True
if s[0] != 'A': ok = False
c_counter = 0
p = -1
for i in range(2,n-1):
    if s[i] == 'C':
        c_counter += 1
        p = i
if c_counter != 1: ok = False
if ok == 0: 
    print('WA')
    exit()
for i in range(n):
    if i == 0 or i == p: continue
    if ord(s[i]) < 97: ok = False
if ok: 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()
a = s.lower()
l = len(s)
c = 0
n = 0

if s[0] == 'A':
  for i in range(2 , l-1):
    if s[i] == 'C':
      c += 1
  if c == 1:
    for i in range(1,l):
      if s[i] != a[i]:
        n += 1
    if n == 1:
      print('AC')
      exit()
print('WA')

Solution (Python):
s=input()
if s[0]=='A' and s[2:-1].count('C')==1:
    for i in range(len(s)):
        if not (i==0 or i==s[2:-1].index('C')+2):
            if not s[i].islower():
                print('WA')
                exit()
    print('AC')
    exit()
print('WA')

Solution (Python):
s = input()
num_C = 0

for i in range(len(s)):
    if i == 0:
        if s[i] != 'A':
            print('WA')
            exit() 
    elif i >= 2 and i <= len(s)-2:
        if s[i] == 'C': num_C += 1
    else:
        if ord(s[i]) < ord('a') or ord(s[i]) > ord('z'):
            print('WA')
            exit()
if num_C != 1:
    print('WA')
    exit()
print('AC')

Solution (Python):
S = input()
cond1 = (S[0]=="A")
cond2 = (S[2:len(S)-1].count("C") == 1)


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

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

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

Solution (Python):






S = input()





mylist = [x for x in S]
if mylist[0] != "A":
    print("WA")
elif mylist[2:-1].count("C") != 1:
    print("WA")
else:
    C_idx = mylist[2:-1].index("C") + 2
    mylist.pop(C_idx)
    if str("".join(mylist[1:])).islower():
        print("AC")
    else:
        print("WA")

Solution (Python):
def resolve():
    S = str(input())
    if S[0] != 'A':
        print('WA')
        return

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

    if S.replace('A', 'a').replace('C', 'c') != S.lower():
        print('WA')
        return

    print('AC')

    return
resolve()

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

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

Solution (Python):
def main():
    S = input()
    flag = True
    cnt = 0
    for i in range(len(S)):
        if i == 0:
            if S[i] != 'A':
                print("WA")
                return
        else:
            if 2 <= i <= len(S)-2 and S[i] == 'C':
                cnt += 1
            elif S[i].isupper():
                print("WA")
                return
    if cnt == 1:
        print("AC")
    else:
        print("WA")
            
main()

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

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

Solution (Python):
s=input()
ans="WA"
if s[0]=="A":
    if s[2:-1].count("C")==1:
        s=list(s)
        s.remove("A")
        s.remove("C")
        for j in range(len(s)):
            if ord(s[j])<ord("a"):
                break
        else:
            ans="AC"
print(ans)

Solution (Python):
S = input()
n = len(S)
up = 0
flag = False

for i, s in enumerate(S):
    if (i == 0) & (s != 'A'):
        break
    if s.isupper():
        up += 1
    if (1 < i) & (i < n-1):
        if s == 'C':
            flag = True

if flag & (up == 2):
    print('AC')
else:
    print('WA')

Solution (Python):
s=input()
n=len(s)
if n==4:
    x=s[2]
else:
    x=s[2:n-1]
    
if s[0]!='A':
    print('WA')
    
elif x.count('C')!=1:
    print('WA')
    
else:
    i=x.find('C')
    s=list(s)
    s.pop(i+2)
    s.pop(0)
    s=''.join(s)
    if s.islower()==True:
        print('AC')
    else:
        print('WA')

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

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

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

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

    ans = False
    break

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

Solution (Python):
import sys
s = input()
ans = 'AC'
c = 0
if s[0] != 'A':
    ans = "WA"
for i in range(2,len(s)-1):
    if "C" == s[i]:
        c += 1
if c != 1:
    ans = "WA"
c = 0
for i in range(len(s)):
    a = ord(s[i])
    if 65 <= a and a <= 96:
        c += 1
if c != 2:
    ans = "WA"
print(ans)

Solution (Python):

s = str(input())
lar = "BDEFGHIJKLMNOPQRSTUVWXYZ"
if s[0] != "A":
    print("WA")
    exit()
elif s[2:len(s)-1].count("C") != 1:
    print("WA")
    exit()
elif s[0:2].count("C") + s[-1].count("C") > 0:
    print("WA")
    exit()
kaz = 0
for i in lar:
    kaz += s.count(i)
if kaz > 0:
    print("WA")
    exit()
print("AC")

Solution (Python):
import re

s = input()

if re.match(r'A[a-z]+C[a-z]+$', s):
    print('AC')
else:
    print('WA')

Solution (Python):
s = input()
cnt = 0

if s[0] == 'A':
    for i in s[2:-1]:
        if i == 'C':
            cnt += 1
    if cnt == 1:
        s = s.replace('A', '')
        s = s.replace('C', '')
        if s.islower() and ('C' not in s):
            print('AC')
            exit()
print('WA')

Solution (Python):
strs=input()
che=True
c=True
coun=False
for i in range(0,len(strs)) :
    if(i==0):
        c=True if strs[i]=="A" else False
    else :
        if(strs[i].isupper()):
            if( (not coun) and i>=2 and i<=len(strs)-2 and strs[i]=='C'):
                coun=True
            else:
                che=False
print("AC") if che and coun and c else print("WA")

Solution (Python):
import sys
from collections import deque
def input(): return sys.stdin.readline().strip()


def main():
    S = input()
    if S[0] != 'A' or ord('A') <= ord(S[1]) <= ord('Z') or ord('A') <= ord(S[-1]) <= ord('Z'):
        print("WA")
        return
    capital = []
    for i in range(2, len(S) - 1):
        if ord('a') <= ord(S[i]) <= ord('z'): continue
        capital.append(S[i])
    
    if capital == ['C']:
        print("AC")
    else:
        print("WA") 


if __name__ == "__main__":
    main()

Solution (Python):
def resolve():
    S = input()
    abc = "abcdefghijklmnopqrstuvwxyz"
    count = 0
    if S[0]=="A":
        S = S[1:]
        if "C" in S[1:-1] and S.count("C")==1:
            S = S[:S.index("C")] + S[S.index("C")+1:]
            for i in range(len(S)):
                if S[i] in abc:
                    count += 1
            if count == len(S):
                print("AC")
            else:
                print("WA")
        else:
            print("WA")
    else:
        print("WA")
resolve()