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

flag = True

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

if not "C" in s[2:-1] or not s[2:-1].count("C") == 1:
    flag = False
    
if s.replace("A", "").replace("C", "").islower() == False:
    flag = False

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

Solution (Python):
import sys
input = sys.stdin.readline
S = input()
a = "WA"
count = 0
b = 0
if S[0] == 'A' :
    k = S[1]
    K = k.lower()
    if k == K :
        for i in range(2,len(S)-2) :
            if S[i] == "C" :
                count +=1
        for i in range(2,len(S)) :
            if S[i] != "C" :
                k = S[i]
                K = k.lower()
                if k != K :
                    b = 1
                    break
        if count == 1 and b == 0 :
            a = "AC"
print(a)

Solution (Python):
S = input()

if S[0]!='A':
  print('WA')
  exit()
else:
  S_withoutA = S.replace('A','')

S_part = [i for i in S[2:-1] if i=='C']
if len(S_part) != 1:
  print('WA')
  exit()
else:
  S_withoutAC = S_withoutA.replace('C','')

if S_withoutAC.islower():
  print('AC')
else:
  print('WA')

Solution (Python):

s = list(input())
status = 0
c = 0
word = [chr(ord('A') + i) for i in range(26)]

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

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

Solution (Python):

s = list(input())
status = 0
c = 0
word = [chr(ord('A') + i) for i in range(26)]






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

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

Solution (Python):
import re

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

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

Solution (Python):
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


s = sys.stdin.buffer.readline().decode().rstrip()

ok = True
ok &= s[0] == 'A'
ok &= s[2:-1].count('C') == 1
uc = 0
for c in s:
    if c in string.ascii_uppercase:
        uc += 1
ok &= uc == 2
if ok:
    print('AC')
else:
    print('WA')

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

c = 0
f = len(s)
if s.count('C') == 1:
    d = s.index('C')
else:
    d = 0
for i in range(0,len(s)):
    if s[i].isupper() == True:
        c += 1
if s[0] == 'A':
    if d < f-1 and d > 1:
        if c == 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 (s.replace('A','a').replace('C','a').islower()):
    print('AC')
else:
    print('WA')

Solution (Python):

 
import math
import itertools
import sys
import copy
 



S = list(str(input()))

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

cflag = False
for i in range(2, len(S)-1) :
  
  if S[i] == "C" :
    S[i] = "c"
    cflag = True
    break

if cflag == False :
  print ("WA")
  exit()
    
for j in range(len(S)) :
  if S[j].islower() == False :
    print ("WA")
    exit()
print ("AC")

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

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

    if S[0] == 'A':
        count = 0
        for i in range(2, 2+len(S[2:-1])):
            if S[i] == 'C':
                count += 1
                index = i
        if count == 1:
            S = S[1:index]+S[index+1:]
            if S.islower():
                print('AC')
                return
    print('WA')


if __name__ == '__main__':
    main()

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(str(input()))
count = 0

def wa():
    print('WA')
    exit(0)

for i in range(len(s)):
    
    if i == 0:
        if s[i] != 'A':
            wa()
    elif s[i] == 'C':
        count += 1
        if not (2 <= i < len(s)-1):
            wa()
        elif count > 1:
            wa()
    elif s[i].isupper():
        wa()
if count < 1:
    wa()

print('AC')

Solution (Python):


s = input().rstrip()

def isValid(s:str):
    if s[0] != "A":
        return False
    if s[1] == s[1].upper():
        return False
    sub = s[2:-1]
    if len([i for i in sub if i == "C"]) != 1:
        return False

    sub2 = s[1] + sub.replace("C", "") + s[-1]
    if sub2 != sub2.lower():
        return False
    return True

ans = "AC"

if not isValid(s):
    ans = "WA"

print(ans)

Solution (Python):
import sys

s = sys.stdin.readline().rstrip()

def main():
    if s[0] == 'A':
        if 'C' in s[2:-1]:
            cnt = 0
            for letter in s:
                if 65 <= ord(letter) <= 90:
                    cnt += 1
            if cnt == 2:
                return 'AC'
    return 'WA'

if __name__ == '__main__':
    ans = main()
    print(ans)

Solution (Python):
import re
S=input()
flg=True
if re.match(r"^[^A]",S):
  flg=False
if len(re.findall(r"C",S[2:-1])) != 1:
  flg=False
for i in range(1,len(S)):
  if S[i]!="C" and S[i].isupper():
    flg=False
print("AC" if flg else "WA")

Solution (Python):
S=input()
flg=True
if S[0]!="A":
  flg=False
if S[2:-1].count("C")!=1:
  flg=False
for i in range(1,len(S)):
  if S[i]=="C" and i!=len(S)-1:
    continue
  if S[i].isupper():
    flg=False
print("AC" if flg else "WA")

Solution (Python):
s = input()

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

Solution (Python):
s=input()

ans=False

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

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

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

if s[0]=='A':
    if s.count('C')==1 and s[1]!='C' and s[len(s)-1]!='C':
        s.remove('A')
        s.remove('C')
        s=''.join(s)
        if s.islower()==True:
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

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

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

if count != 1:
    flag = False

for i in range(len(S)):
    if S[i] == "C" or S[i] == "A":
        continue
    if S[i] != S[i].lower():
        flag = False

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

Solution (Python):
s = input()

flag = [0] * 3

if s[0] == 'A':
	flag[0] += 1
	s = 'a' + s[1:]

Ccnt = 0
for i in range(2, len(s) - 1):
	if s[i] == 'C':
		Ccnt += 1
		s = s[:i] + 'c' + s[i+1:]

if Ccnt == 1:
	flag[1] = 1

if s.islower() is True:
	flag[2] = 1


if sum(flag) == 3:
	print('AC')
else:
	print('WA')

Solution (Python):
s = str(input())
cnt = 0
lst = []

if s[0]=='A' and s.count('C', 2, -1)==1:

    for i in range(1,len(s)):
        if s[i] != s[s.find('C',2, -1)]:
            lst.append(s[i])

    t = ''.join(lst)

    if t== str(t.upper()).lower():
        print('AC')
    else:
        print('WA')

else:
    print('WA')

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

for i in range(len(s)):
    if i == 0:
        if s[i] != "A":
            ans = "WA"
            break
    elif 2 <= i <= len(s)-2 and s[i] == "C":
        cnt += 1
    elif s[i] != s[i].lower():
        ans = "WA"
        break
else:
    if cnt != 1: ans = "WA"

print(ans)

Solution (Python):
S=input()

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

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

flag = 0

if S[0] == 'A':
    if S[2:-1].count("C") == 1:
        S.remove("A")
        S.remove("C")
        for s in S:
            if s.islower():
                continue
            else:
                flag = 1
                break
        if flag == 0:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
import sys
input = sys.stdin.readline
S = list(input().rstrip())
N = len(S)
cnt = 0
for i in S:
    cnt += i.isupper()
if cnt != 2:
    print("WA")
    sys.exit()
if S[0] != "A":
    print("WA")
    sys.exit()
if "C" not in S[2:N-1]:
    print("WA")
    sys.exit()
print("AC")

Solution (Python):
s = list(input())
hani = (ord("a"),ord("z"))

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

del s[0]
cc = 0
for i in range(1,len(s)-1):
    if s[i] == "C":
        cc+=1
        d = i
        

if cc != 1:
    print("WA")
    exit()

del s[d]

for i in s:
    if not hani[0] <= ord(i) <= hani[1]:
        print("WA")
        exit()

print("AC")

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

Solution (Python):
s = input()

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

Solution (Python):
S=input()
L=len(S)
ans='AC'

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

cnt=0

for i in range(1,L):
    if S[i].isupper():
        if i==1 or i==L-1 or S[i] != 'C':
            ans='WA'
        cnt+=1

if cnt != 1:
    ans='WA'

print(ans)

Solution (Python):
S = input()

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

count = 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"
                count += 1
        
if count != 1:
        ans = "WA"
print(ans)

Solution (Python):
S = input()

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


if not S[1].islower() or not (S[-1].islower()):
        
        print("WA")
        exit()


flag = False
for i in range(2, len(S)-1):
        if flag == True and S[i] == "C":
                print("WA")
                exit()
        if flag == False and S[i] == "C":
                flag = True
                continue
        if not S[i].islower():
                print("WA")
                exit()
if flag:
        print("AC")
else:
        print("WA")

Solution (Python):
import re

ptn = re.compile(r'A[a-z]+C[a-z]+')
print('AC' if re.fullmatch(ptn, input()) else 'WA')

Solution (Python):
s=input()

def check(s):
    if not s[0] == 'A':
        return False
    if not s[2:-1].count('C') == 1:
        return False
    
    count=0
    
    for i in s[1:]:
        if not i.lower() == i:
            count+=1
            if count>1:
                return False
        
    return True
print("AC" if check(s) else "WA")

Solution (Python):
s=input()
flg=True
if s[0]!="A":
    flg=False
cnt=0

for i in s[2:-1]:
    if i=="C":
        cnt+=1

if cnt!=1:
    flg=False
cnt=0
for i in s:
    if i.isupper():
        cnt+=1
if cnt!=2:
    flg=False
if flg:
    print("AC")
else:
    print("WA")

Solution (Python):


s = input()

isStartwithA = False
has1CinMiddle = False
otherArelower = True

if list(s)[0] == "A":
    isStartwithA = True


sample = list(s)[2:-1]
if sample.count("C") == 1:
    has1CinMiddle = True

sample2 = list(s)
sample2 = list(set(sample2))

try:
    sample2.remove("A")
    sample2.remove("C")
except:
    pass
    isStartwithA = False
    has1CinMiddle = False



for word in sample2:
    if (not word.islower()):
        otherArelower = False

if isStartwithA and has1CinMiddle and otherArelower:
    print("AC")
else:
    print("WA")

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


if S[0] == "A":
    C = S[2:-1]
    count = 0
    for c in C:
        if c == "C":
            count = count + 1
        if count==2:
            print("WA")
            sys.exit()
    if count==0:
        print("WA")
        sys.exit()
    S = S[1:]

    for s in S:
        if (ord("z") >= ord(s) and ord("a") <= ord(s)):
            continue
        elif s=="C":
            continue
        else:
            print("WA")
            sys.exit()
    print("AC")
    sys.exit()
print("WA")

Solution (Python):
S = input()
if S[0] != "A":
    print("WA")
else:
    l = [x for x in S[2:-1] if x == "C"]
    if len(l) != 1:
        print("WA")
    else:
        i = S.index("C")
        for x in S[1:i]+S[i+1:]:
            if not x.islower():
                print("WA")
                exit()
        else:
            print("AC")

Solution (Python):
S=input()
case1=False
case2=False
cnt=0
for i in range(len(S)):
  if i==0 and S[i]=="A":
    case1=True
  if S[i]=="C" and 2<=i<=len(S)-2:
    case2=True
  if S[i].lower()!=S[i]:
    cnt+=1
if case1 and case2 and cnt==2:
  print("AC")
else:
  print("WA")

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

Solution (Python):
S = str(input())
sub = S[2:-1]
cnt = 0
if S[0] != "A":
    print("WA")
    exit()
for i in range(len(sub)):
    if sub[i] == "C":
        cnt += 1
        if cnt >= 2:
            print("WA")
            exit()
if cnt == 0:
    print("WA")
    exit()
ans = S.replace("A","").replace("C","")
if not ans.islower():
    print("WA")
    exit()
print("AC")

Solution (Python):
s = input()

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

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

for i in s[1:]:
    if i == "C":
        continue
    if i.isupper():
        flag = False

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

Solution (Python):
s = input()
check = True
count_C = s[2:-1].count("C")
for i in range(len(s)):
    if i == 0:
        if not (s[i] == "A"):
            check = False
    elif i == 1:
        if not (s[i].islower()):
            check = False
    else:
        if not(s[i].islower()) and not(s[i] == "C"):
            check = False
if check and count_C == 1:
    print("AC")
else:
    print("WA")

Solution (Python):
s = input()

if s[0] != 'A' :
  print("WA")
elif s[2:-1].count('C') !=1:
  print("WA")
else:
  s = ''.join([i for i in s if i not in 'AC'])
  if s.islower() :
    print('AC')
  else  :
    print('WA')

Solution (Python):
S = input()


def check(s):
    if not s[0] == "A":
        return False
    if not s[2:-1].count("C") == 1:
        return False
    count = 0
    for c in s[1:]:
        if not c.lower() == c:
            count += 1
            if count > 1:
                return False
    return True


print("AC" if check(S) else "WA")

Solution (Python):
S=input()
n=len(S)
dai='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
sho='abcdefghijklmnopqrstuvwxyz'

out='AC'
if S[0]!='A':
  out='WA'
  
counter=0
ind=0
for i in range(2, n-1):
  if S[i]=='C':
    counter+=1
    ind=i
    
if counter!=1:
  out='WA'
  
for i in range(n):
  if i!=0 and i!=ind:
    for j in range(26):
      if S[i]==dai[j]:
        out='WA'
        
print(out)

Solution (Python):

import re

S = input()
flag = 0

if S[0] == 'A':
    flag += 1

if S[2:len(S)-1].count('C') == 1:
    flag += 1

if len(re.findall(r'[A-Z]', S[1:])) == 1:
	flag += 1



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

Solution (Python):
import re


print(re.match("A[a-z]+C[a-z]+$", input()) and "AC" or "WA")

Solution (Python):

S = input()
flag = 0

if S[0] == 'A':
    flag += 1

if S[2:len(S)-1].count('C') == 1:
    flag += 1

up_case = 0
for i in range(1, len(S)):
    if S[i].isupper() == True:
        up_case += 1

if up_case == 1:
    flag += 1


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

Solution (Python):
s=input()
flag=1
if s[0]!="A":
    flag=0
else:
    t= s[2:-1].replace("C","",1)
    u= s[2:-1].replace("C","",2)
    if s[2:-1]==t or t!=u:
        flag=0
    else:
        t = s.replace("A","",1).replace("C","",1)
        if t.lower()!=t:flag=0
print("AC" if flag else "WA")

Solution (Python):
def judge(string):
    if string[0] != "A" or "C" not in string[2:len(string) - 1]:
        return False
    list_ = list(string)
    list_.remove("A")
    list_.remove("C")
    return all(c.islower() for c in list_)

print("AC" if judge(input()) else "WA")

Solution (Python):


S = input()

ans = 'WA'

if S[0] == 'A' and S[2:-1].count('C') == 1:
    a = S[2:-1].replace('C','c')
    if a.islower() and S[-1].islower() and S[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()

C = False
for s in S[2:-1]:
    if s == 'C':
        if not C:
            C = True
            continue
        else:
            print('WA')
            exit()

    if s.isupper():
        print('WA')
        exit()

if C:
    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):
w=input()
flag=0
if w[0]=='A' and w.count('C')==1 and w.count('A')==1 and w[1].lower()==w[1] and w[-1].lower()==w[-1]:
    flag+=0
else:
    flag=1    
if w.replace('A','').replace('C','').lower()==w.replace('A','').replace('C',''):
    flag+=0
else:flag=1
if flag:print('WA')
else:print('AC')

Solution (Python):
s = input()
s.index

def check(s):
    try:
        res = s.index("C", 2, -1)
    except ValueError:
        return False
    if ((s[1:res]+s[res+1:]).islower()):
        return True


if (s[0] == "A" and check(s)):
    print("AC")
else:
    print("WA")

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

if S[0] == "A" and S[2:-1].count("C") == 1:
  S.remove("A")
  S.remove("C")
  for s in S:
    if "a" <= s <= "z":
      pass
    else:
      print("WA")
      break
  else:
    print("AC")
else:
  print("WA")

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

Solution (Python):
import copy

s = list(input())
s_t = copy.deepcopy(s)


counter = 0
 
if s[0] != "A":
    print("WA")
    exit()
 
if not "C" in s[2:-1]:
    print("WA")
    exit()
 

c = False
komojo = True

for i in range(len(s)):
    if  2 <= i <= len(s)-2:
        if s[i] == "C":
            if c == True:
                print("WA")
                exit()
            elif c != True:
                c = True
            
        elif not s[i].islower():
            komojo = False
    elif i != 0 and not s[i].islower():
        komojo = False
        

if c and komojo:
    print("AC")
else:
    print("WA")

Solution (Python):
s=input()
flag = "AC"
if s[0] != "A":
    flag = "WA"
else:
    if not "C" in s[2:-1]:
        flag = "WA"
    else:
        ls = [c for c in s]
        ls.remove("A")
        ls.remove("C")
        for c in ls:
            if c.isupper():
                flag = "WA"
print(flag)

Solution (Python):
s=str(input())
if s[0]!="A":
    print("WA")
    exit()
    
if s.count("C")!=1:
    print("WA")
    exit()
    
else:
    x=s.index("C")
    if x>=2 and x<=len(s)-2:
        y=s.replace("A","a")
        z=y.replace("C","c")
        if z.islower():
          print("AC")
        else:
          print("WA")
    else:
        print("WA")

Solution (Python):
s = input()
l = s.find("C")
r = s.rfind("C")
a = s[1:]
a = a.replace("C","")
if s[0] != "A" or s[-1] == "C" or l != r or 2 > l or not a.islower():
  print("WA")
else:
  print("AC")

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

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

Solution (Python):
S = input()
def main():
  if S[0] != "A":
    print("WA")
    exit()
  head = S[:2]
  if head in ("C"):
    print("WA")
    exit()
  tail = S[-1:]
  if tail in ("C"):
    print("WA")
    exit()
  
  sub = S[2:]
  sub = sub[:-1]
  if sub.count("C") != 1:
    print("WA")
    exit()
  
  for x in S[1:]:
    if x !="C":
      if x.isupper():
        print("WA")
        exit()
  print("AC")
  
if __name__ == "__main__":
  main()

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

Solution (Python):
s=input()
flag = "AC"
if s[0] != "A":
    flag = "WA"
else:
    if not "C" in s[2:-1]:
        flag = "WA"
    else:
        ls = [c for c in s]
        ls.remove("A")
        ls.remove("C")
        for c in ls:
            if c.isupper():
                flag = "WA"
print(flag)

Solution (Python):
S = input()

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

print("WA")

Solution (Python):
S = input()

SLEN = (len(S))

A = list(S)



small = 0

for i in range(SLEN):
    if A[i].islower() == True:
        small = small + 1

big = (SLEN - small) 

Check= S[2:SLEN-1]
CNUM=Check.count("C")

if A[0] == "A" and  big == 2 and CNUM == 1 and A[-1] != "C":  
    print("AC")
else:
    print("WA")

Solution (Python):
S = input()
cheack1 = False
cheack2 = False
cheack3 = False
count = 0

if S[0]=='A':
    cheack1=True
    S = S.replace("A", "a")

if S[1]=="C" or S[int(len(S))-1]=="C":
    cheack2==False
else:
    for i in range(2, int(len(S))-1):
        if S[i]=="C":
            count += 1

    if count==1:
        cheack2=True
        S = S.replace("C","c")

cheack3 = S.islower()


if cheack1 and cheack2 and cheack3:
    print("AC")
else:
    print("WA")

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

Solution (Python):
s = input()

if s[0] != 'A':
    print('WA')
    quit()
s = s[1:]

if 'C' not in s[1 : - 1]:
    print('WA')
    quit()
else:
    s = list(s)
    s.pop(s.index('C'))
    s = ''.join(s)
    if s.lower() != s:
        print('WA')
        quit()
print('AC')

Solution (Python):
S = input()
A = False
C = False
ans = 'WA'
if S[0] == 'A':
  A = True
if S[2:-1].find('C') != -1 and S[2:-1].find('C') == S[2:-1].rfind('C'):
  S = S.lstrip('A')
  D = S[S.find('C')+1:]
  E = S[:S.find('C')]
  if D.islower() == True and E.islower() == True:
    C = True
if A == True and C == True:
  ans = 'AC'
print(ans)

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

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

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

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

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

if (s[0] == 'A'
    and len([i for i in s[2:-1] if i == 'C']) == 1
    and str([i for i in s[2:-1] if i != 'C']).islower
    and str.islower(s[1]+s[-1])):
    print('AC')
else:
    print('WA')

Solution (Python):
S=list(input())
x=S.pop(0)
if x!='A':
  print('WA')
else:
  for i in range(1,len(S)-1):
    if S[i]=='C':
      del S[i]
      if str.islower("".join(S)):
        print('AC')
        break
      else:
        print('WA')
        break
  else:
    print('WA')

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

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

Solution (Python):
wa = 0
count = 0
s = input()
if s[0] != "A":
    wa = 1
for i in range(1, len(s)):
    if s[i] == "C" and i not in  {len(s)-1,1} :
        count += 1
        if count >= 2:
            wa = 1
    else:
        if s[i].isupper():
            wa = 1
print("AC" if not wa and count else "WA")

Solution (Python):
S=input()
N=len(S)
if S[0]!='A':
    print('WA')
else:
    cnt = 0
    for i in range(2,N-2+1):
        if S[i]=='C':
            cnt += 1
    if cnt != 1:
        print('WA')
    else:
        D=(S[0].isupper()>0)
        flg=0
        for i in range(1,N):
            if D==(S[i].isupper()>0):
                flg+=1
        if flg==1:
            print('AC')
        else:
            print('WA')

Solution (Python):
import sys
import re


cnt = 1
input_arr = []
for l in sys.stdin:
  input_arr.append(l.split("\n")[0])
  if len(input_arr) == cnt:
      break
S = input_arr[0]
if len(re.sub(r'A[a-z]+C[a-z]+', '', S)) == 0:
    print("AC")
else:
    print("WA")

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

Solution (Python):
s = input()

test = 0
check = 0

if s[0]=='A':
	for i in range(2,len(s)-1):
		if s[i]=='C':
			test = test + 1
			
	if test == 1:
		for j in range(len(s)):
			if s[j]=='A':
				pass
			elif s[j]=='C':
				pass
			elif s[j].isupper():
				pass
			else:
				check = check +1
			
		if check == len(s)-2:	
			print('AC')
		else:
			print('WA')
		
	else:
		print('WA')

else:
	print('WA')

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

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

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

Solution (Python):
s = input()
if s[0] == "A":
    s = s[1:]
else:
    print('WA')
    exit()
flag = 1
for i in range(1,len(s)-1):
    if s[i] == "C":
        s = s[:i]+s[i+1:]
        flag = 0
        break

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

Solution (Python):
s=input()
n=len(s)
if s[0] != "A":
  print("WA")  
  exit()
if s[2:n-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):
import sys
s=list(input())
n=len(s)
if s[0]!="A":
    print("WA")
    sys.exit()
    
C_count=0
word=list("abcdefghijklmnopqrstuvwxyz")
for i in range(2,n-1):
    if s[i]=="C":
        C_count+=1
    elif s[i] in word:
        continue
    else:
        print("WA")
        sys.exit()
if C_count==1:
    if s[1] in word and s[n-1] in word:
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
import numpy as np

S=np.asarray(list(input()))
cond1=(S[0]=="A") 
ci=(S=="C") 
cond2=(ci[2:-1].sum()==1) 
Snac=S[np.logical_not(ci)][1:] 
cond3=np.char.islower(Snac).all() 

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

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

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

Solution (Python):
A = list(input())
k = False
p = False
if A[0] == 'A' and A[1].islower() == True and  A[-1].islower() == True and "C" in A[2:-1]:
  A.pop(0)
  A=str(A)
  A = A.replace('C', '', 1)
  k = A.islower()
if k:
  print('AC')
else:
  print('WA')

Solution (Python):
A = list(input())
k = False
p = False
if A[0] == 'A' and A[1].islower() == True and  A[-1].islower() == True:
  A.pop(0)
  A=str(A)
  for a in A:
    if a == 'C':
      p =True
  A = A.replace('C', '', 1)
  k = A.islower()
if k and p:
  print('AC')
else:
  print('WA')

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

print(ans)

Solution (Python):

import re

def solve(S: str):
    pattern = "A[a-z][a-z]*C[a-z]+"
    if re.fullmatch(pattern, S):
        print("AC")
    else:
        print("WA")


def main():
    S = str(input())
    solve(S)

if __name__ == '__main__':
    main()

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

Solution (Python):
S=input()
C1=S[0]=='A' and S[-1].islower()
C1=C1 and S[1].islower()
C2=0
C3=0
for i in S[2:len(S)-1]:
  if i=='C':
    C2+=1
  elif i.islower():
    C3=C3
  else:
    C3+=1
if C1 and C2==1 and C3==0:
  print('AC')
else:
  print('WA')

Solution (Python):
s = list(input())
ans = "AC"
if s[0]!="A":
    ans ="WA"

n = len(s)
a = 0
for i in range(1,n):
    x = ord(s[i])
    if x==ord("C") and i!=1 and i!=n-1:
        a+=1
        continue
    
    if ord("a")<=x and x <= ord("z"):
        continue
    else:
        ans ="WA"
if a!=1:
    ans ="WA"
print(ans)

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

Solution (Python):
S = input()
ans = 'AC'
if S[0] != 'A':
    ans = 'WA'
cnt = 0
for i in S[2:len(S) - 1]:
    if i == 'C':
        cnt += 1
if cnt != 1:
    ans = 'WA'
cnt = 0
for i in S:
    if 'A' <= i and i <= 'Z':
        cnt += 1
if cnt != 2:
    ans = 'WA'
print(ans)