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):
import math
from collections import deque
from collections import defaultdict

import itertools as it


def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): 
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): 
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} 
def bitArr(n):
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): 
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq
def get_sieve_of_eratosthenes(n):
	
	data = [0,0,0]
	for i in range(3,n+1,2):
		data.append(i)
		data.append(0)
	for i in range(len(data)):
		interval = data[i]
		if interval!=0:
			for j in range(i+interval,n-1,interval):
				data[j] = 0
	
	ans = data[:]
	return ans

s = input()

f1 = s[0]=="A"

f2 = s[2:-1].count("C")==1

t=""
for i in s:
	if i!="A" and i!="C":
		t+=i

f3 = t == t.lower()

if f1*f2*f3:
	print("AC")
else:
	print("WA")

Solution (Python):
s = str(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 = str(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):
def mi():
    return map(int, input().split())

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

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

    if S[0].replace('A', 'a')+S[1]+S[2:-1].replace('C', 'c')+S[-1:] != S.lower():
        print('WA')
        return

    print('AC')

if __name__ == '__main__':
    main()

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


if not s.islower():
  AC="WA"
  
print(AC)

Solution (Python):
import sys, math, itertools, collections, bisect 
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

s = input()
chk_C = False
if s[0] != "A":
    print("WA")
    exit()
else:
    for i in range(len(s)):
        if i == 0:
            pass
        else:
            if s[i] == "C" and chk_C == False and i >= 2 and i <= len(s)-2:
                chk_C = True
                pass
            elif s[i] == s[i].lower():
                pass
            else:
                print("WA")
                exit()
    if chk_C == True:
        print("AC")
    else:
        print("WA")

Solution (Python):




s=list(input())
chk=list("abcdefghijklmnopqrstuvwxyz")
flag="WA"
n=len(s)

if s[0]=="A":
    temp=s[2:n-1]
    if temp.count("C")==1:
        ind=temp.index("C")
        ind+=2
        del s[0]
        del s[ind-1]
        for st in s :
            if st in chk:
                pass
            else:
                flag="WA"
                break
            flag="AC"
print(flag)

Solution (Python):
S = list(input())
if S[0] != 'A':
    print('WA')
    exit()
S[0] = 'a'
if S.count('C') != 1:
    print('WA')
    exit()
i = S.index('C')
if i == 1 or i == len(S)-1:
    print('WA')
    exit()
S[S.index('C')] = 'c'
if ''.join(S) == ''.join(S).lower():
    print('AC')
else:
    print('WA')

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

Solution (Python):
s = input()
n = len(s)
if s[0] == "A" and s[2:n-1].count("C") == 1 and len(set(s.upper()) & set(s)) == 2:
  print("AC")
else:
  print("WA")

Solution (Python):
s = input()
n = len(s)
if s[0] == "A" and s[2:n-1].count("C") == 1 and len(set(s.upper()) & set(s)) == 2:
    print("AC")
else:
    print("WA")

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:
    s = s.replace('A', '').replace('C', '')
    for c in s:
        if ord(c) < ord('a'):
            print('WA')
            exit(0)
    print('AC')
else:
    print('WA')

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

s1 = re.fullmatch(r"A([a-z]+)C([a-z]+)", s)

if s1 == None:
    print("WA")
else:
    print("AC")

Solution (Python):
s = input()

j1 = s[0] == 'A'
j2 = s[2:-1].count('C') == 1
j3 = True

s3 = set(s) - set('AC')
for i in s3:
    if i != i.lower():
        j3 = False
        break

print('AC') if j1 and j2 and j3 else print('WA')

Solution (Python):
S = input()
abc = 'abcdefghijklmnopqrstuvwxyz'
if S[0] == 'A':
  if S[2:len(S)-1].count('C') == 1:
    for c in S:
      if (c!='A') and (c!='C') and (c not in abc):
        print('WA')
        exit()
    else:
      print('AC')
  else:
    print('WA')
else:
  print('WA')

Solution (Python):
s = input()

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

if not list(s[2:-1]).count("C") == 1:
    print ("WA")
    exit ()

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

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

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

Solution (Python):
import re
s = input()
p = re.compile('[a-z]+')
ans = ''
if s[0] == 'A' and s[2:-1].count('C') == 1:
  s = s.replace('A', '').replace('C', '')
  if p.fullmatch(s):
    ans = 'AC'
  else:
    ans = 'WA'
else:
  ans = 'WA'
print(ans)

Solution (Python):
s = input()
n = len(s)
p = list(s[2:(n-1)])
if s[0] == "A":
    flag = 1
else:
    print("WA")
    quit()
cnt = 0
for i in range(2,n-1):
    if s[i] == "C":
        cnt += 1
    elif s[i].isupper():
        flag = 0
if flag and s[1].islower() and s[n-1].islower() and cnt==1:
    print("AC")
else:
    print("WA")

Solution (Python):
S = input()
if S[0] == 'A' and S[2:-1].count('C') == 1:
    chk = S.replace('A', '').replace('C', '')
    l = len(chk)
    cnt = 0
    for s in chk:
        if s.islower():
            cnt += 1
    if cnt == l:
        print('AC')
        exit()
print('WA')

Solution (Python):
s=list(input())
if s[0]!='A':
  print("WA")
elif s[2:len(s)-1].count("C")!=1:
  print('WA')
else:
  s.remove('A')
  s.remove('C')
  ns=str(s)
  if ns.islower():
    print("AC")
  else:
    print("WA")

Solution (Python):
S = input()

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

Solution (Python):
s=list(input())
flag=1
if s[0]!='A':
    flag=0
if 'C' not in s[2:-1]:
    flag=0
if s.count('C')!=1:
    flag=0
if 'A' in s:
    s.remove('A')
if 'C' in s:
    s.remove('C')
s=''.join(s)
if s.islower():
    pass
else:
    flag=0
if flag==1:
    print('AC')
else:
    print('WA')

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

Solution (Python):
S = input()
charset = set(list(S))
if 'A' in charset:
    charset.remove('A')
if 'C' in charset:
    charset.remove('C')

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

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

count = 0
if S[0] != "A" or not S[1].islower() or not S[-1].islower():
    print("WA")
else:
    count = 0
    for i in range(2, n-1):
        c = S[i]
        if c == "C":
            if count == 1:
                print("WA")
                break
            else:
                count = 1
        elif not c.islower():
            print("WA")
            break
    else:
        if count == 1:
            print("AC")
        else:
            print("WA")

Solution (Python):
s=list(input())
s1=s[2:-1]
f=True
if s[0]!='A':
	f=False
elif 'C' not in s1:
	f=False
else:
	s.remove('A')
	s.remove('C')
	if str(s).islower():
		pass
	else:
		f=False
if f:
	print('AC')
else:
	print('WA')

Solution (Python):
S = input()
flag = 1
if S[0] != "A":
	flag = 0
elif S[2:-1].count("C") != 1:
	flag = 0
else:
	idx = S[2:-1].find("C")
	S2 = S[1:idx+2]+ S[idx + 3:]
	if not S2.islower():
		flag = 0

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

Solution (Python):
import sys
S = input()
if S[0] != "A":
  print("WA")
  sys.exit()

if S[1:].count('C') != 1:
  print("WA")
  sys.exit()

Cindex = S.find("C")
if Cindex < 2 or Cindex > len(S)-2:
  print("WA")
  sys.exit()
  
T = 'a' + S[1:]
T = T[0:Cindex] + "c" + T[Cindex+1:]

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

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

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

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

Solution (Python):

import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial
from bisect import bisect_left 
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

S = input()

cond1 = S[0] == 'A'
cond2 = S[2:-1].count('C') == 1
cond3 = True
for i, s in enu(S):
    if i==0:
        continue
    if 2<=i<=len(S)-2 and s=='C':
        continue
    if s == s.upper():
        cond3 = False

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

Solution (Python):
s = input()
ac = True
c = True
if s[0] != "A":
  ac = False
if not ord("a") <= ord(s[1]) <= ord("z"):
  ac = False
if not ord("a") <= ord(s[-1]) <= ord("z"):
  ac = False
for i in range(2, len(s)-1):
  if s[i] == "C":
    if c:
      c = False
    else:
      ac = False
  else:
    if not ord("a") <= ord(s[i]) <= ord("z"):
      ac = False
if c:
  ac = False
if ac:
  print("AC")
else:
  print("WA")

Solution (Python):
S = input()

if S[0] == "A" and S.count("A") == 1 and S.count("C") == 1:
    p = S.find("C")
    b = S.replace("A","").replace("C","")
    if p > 1 and p < len(S) - 1 and b.islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

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

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

if S[0] == "A":
    next = S[2:-1]

    if next.count("C") == 1:
        next = list(S[1:])
        next.remove("C")
        next = str(next)

        if next.islower():
            print("AC")
            exit()

print("WA")

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

if S[0] == "A":
    next = S[2:-1]

    if next.count("C") == 1:
        next = list(S[1:])
        next.remove("C")
        next = str(next)

        if next.islower():
            print("AC")
            exit()

print("WA")

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

S = list(input())

def ok(s):
    if S[0] != 'A':
        return False
    if S[-1] == 'C' or S[1] == 'C':
        return False

    if len(list(filter(lambda x : x == 'C', S[2:]))) != 1:
        return False


    if list(map(lambda x: x.lower() if x not in ['A', 'C'] else x, s)) != s:
        return False

    return True

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

Solution (Python):
ans = "WA"
s = list(input())
if s[0] == "A":
    c_index = [i for i, x in enumerate(s[2:-1]) if x == 'C']
    if len(c_index) == 1:
        s.pop(c_index[0] + 2)
        s.pop(0)
        s = "".join(s)
        if s.islower():
            ans = "AC"
print(ans)

Solution (Python):
S = list(input())
a_flag = 0
c_flag = 0
c_count = 0
flag2 = 0
if S[0] == 'A':
    a_flag += 1
for i in range(2, len(S)-1):
    if S[i] == 'C' and i == 2:
        c_flag += 1
        c_count += 1
    elif S[i] == 'C':
        c_flag += 1
        c_count += 1
    elif S[i].isupper():
        flag2 += 1

if S[len(S) - 1].isupper() or S[1].isupper():
    flag2 += 1
if a_flag == 1 and c_flag == 1 and flag2 == 0 and c_count == 1:
    print('AC')
else:
    print('WA')

Solution (Python):
s = str(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()
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()
Cs = [i for i, c in enumerate(S) if c == "C" and 2 <= i <= len(S) - 2]
if S[0] == "A" and len(Cs) == 1 and (S[1 : Cs[0]] + S[Cs[0] + 1 :]).islower():
    print("AC")
else:
    print("WA")

Solution (Python):

S = input()


check_one = S[0] == "A"
check_two = S[2:-1].count("C") == 1
check_three = False not in [True if s in ["A", "C"] or s.lower() == s else False for s in list(S)]

if False not in [check_one, check_two, check_three]:
    print("AC")
else:
    print("WA")

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

Solution (Python):
s = input()
ok = True
if s[0] != 'A': ok = False
if s[1] != s[1].lower(): ok = False
if s[-1] != s[-1].lower(): ok = False
c = 0
for si in s[2:-1]:
    if si == 'C': c += 1
if c != 1: ok = False
print('AC' if ok else 'WA')

Solution (Python):

s=input()
if s[0]!="A":
    print("WA")
elif "C" not in s[2:-1] or s[2:-1].count("C")!=1:
    print("WA")
elif s[1]==str.upper(s[1]):
    print("WA")
elif (s[1:2]+s[-1]).strip("C")==str.lower((s[1:2]+s[-1]).strip("C")):
    print("AC")
else:
    print("WA")

Solution (Python):
s = input()
ok = True
if s[0] != 'A': ok = False
c = 0

for si in s[2:-1]:
    
    if 'C' == si:
        c += 1
if c != 1: ok = False

for si in s[1:2]+s[-1]:
    
    if si != si.lower(): ok = False

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

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

ans = 'AC'
if S[0] == 'A':
    del S[0]
    for i in range(1, len(S)-1):
        if S[i] == 'C':
            del S[i]
            ans = 'AC'
            break
        else:
            ans = 'WA'
    for j in range(len(S)):
        if S[j].isupper():
            ans = 'WA'
else:
    ans = 'WA'
print(ans)

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):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = list(input())

if S[0] == "A" and "C" in S[2:-1]:
	S.remove("A")
	S.remove("C")
else:
	print("WA")
	exit()

for x in S:
	if not x in ascii_lowercase:
		print("WA")
		exit()
else:
	print("AC")

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = list(input())

if S[0] == "A" and "C" in S[2:-1]:
	S.remove("A")
	S.remove("C")
else:
	print("WA")
	exit()

for x in S:
	if not x in ascii_lowercase:
		print("WA")
		exit()
else:
	print("AC")

Solution (Python):
s = input()
if s[0] != 'A':
	print("WA")
	exit()
else:
	s = s[1:]
if 'C' not in s[1:-1]:
	print("WA")
	exit()
else:
	i = s.index('C')
	s = s[:i] + s[i+1:]
print("AC" if s.islower() else "WA")

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

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

Solution (Python):
s = input()
if s[0] != 'A':
    print('WA')
    exit()

if s.count('C', 2, -1) != 1:
    print('WA')
    exit()

s2 = s[1:].replace('C', '')
if not s2.islower():
    print('WA')
    exit()

print('AC')

Solution (Python):
s = input()
if s[0] != 'A':
    print('WA')
    exit()

import collections
cnt = collections.Counter(s[2:-1])
if cnt['C'] != 1:
    print('WA')
    exit()

s2 = s[1:].replace('C', '')
if not s2.islower():
    print('WA')
    exit()

print('AC')

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

Solution (Python):
import bisect
import copy
import heapq
import math
import sys
from collections import *
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

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

ccnt=0
for i in range(len(s)):
    if i==0:
        if s[i]!="A":
            print("WA")
            break
        else:
            continue

    elif 2<=i<=len(s)-2 and s[i]=="C":
        ccnt+=1
    elif not s[i] in al:
        print("WA")
        break
else:
    if ccnt==1:
        print("AC")
    else:
        print("WA")

Solution (Python):

S = input()
if S[0] == 'A' and 'C' in S[2:-1] and S[1:S.find('C')].islower() is True and S[S.find('C')+1:].islower() is True:
    print('AC')
else:
    print('WA')

Solution (Python):
s = input()

if(s[0] =="A"):
  if(s[2:-1].count("C") == 1):
    a = s.index("C")
    s = list(s)
    del s[0]
    del s[a-1]
    s = ''.join(s)
    if(s.islower()):
      print("AC")
    else:
      print("WA")
  else:
    print("WA")
else:
  print("WA")

Solution (Python):
s=input()
flag=True
count=0

if(s[0]!='A'):
    flag=False

for i in range(2,len(s)-1):
    if(s[i]=='C'):
        count+=1
if(count!=1):
    flag=False

for i in s:
    if(i.islower()==False and i!='A' and i!='C'):
        flag=False

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

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

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

Solution (Python):
S=list(input())
l=len(S)
if S[0]!='A':
  print('WA')
  exit()
if S.count('C')!=1:
  print('WA')
  exit()
if S.index('C')<2 or l-2<S.index('C'):
  print('WA')
  exit()
  
S.remove('A')
S.remove('C')
s=''.join(S)
if s.islower()==True:
  print('AC')
else:
  print('WA')

Solution (Python):
def resolve():
	s = input()
	if s[0] != 'A':
		print('WA')
		return
	cnt = False
	for i in s[2:-1]:
		if i == 'C':
			cnt += 1
	if cnt != 1:
		print('WA')
		return
	for i in s:
		if i == 'A' or i == 'C':
			continue
		if i.isupper():
			print('WA')
			return
	print('AC')
resolve()

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

print('WA')

Solution (Python):
S = input()
N = len(S)
out = "AC"
if S[0]!="A":
    out = "WA"
cnt = 0
for i in range(2,N-1):
    if S[i]=="C":
        cnt+=1
if cnt!=1:
    out = "WA"

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

for i in range(1,N-1):
    if S[i]!="C" and S[i] not in al:
        out = "WA"
if S[N-1] not in al:
    out = "WA"

print(out)

Solution (Python):
S = input()
N = len(S)
f = True

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

c = 0
for i in range(2, N-1):
    if S[i] == "C":
        c += 1
if c != 1:
    f = False


for i in S:
    if i not in "AC":
        if i != i.lower():
            f = False
            break
if f:
    print("AC")
else:
    print("WA")

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

Solution (Python):
s=input()
l=[]
L=[s[0]]
for i in range(2,len(s)-1):
    if s[i]=='C':
        L.append(s[i])
    else:
        l.append(s[i])
komoji=''.join(l)
komoji+=(s[1]+s[len(s)-1])

print('AC' if L==['A','C'] and str.islower(komoji) else 'WA')

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

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

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")
    if "".join(s).lower() == "".join(s):
        print("AC")
    else:
        print('WA')
else:
    print("WA")

Solution (Python):
s=input()

if s[0]=="A" and s[2:-1].count("C")==1:
    if (s[1]+s[2:2+s[2:-1].index("C")]+s[s[2:-1].index("C")+3:]).islower():
        print("AC")
    else:
        print("WA")
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")
    
    if "".join(s).lower() == "".join(s):
        print("AC")
    else:
        print('WA')

else:
    print("WA")

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

Solution (Python):
S = list(input())
count = 0
if S[0] == 'A':
    S[0] = S[0].lower()
else:
    print('WA')
    exit()

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

if count == 0:
    print('WA')
    exit()

for i in range(len(S)):
    if S[i] != S[i].lower():
        print('WA')
        exit()
print('AC')

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

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


if s[0] == "A":
    if len([True for c in s[2:-1:] if c == "C"]) == 1:
        s.remove("A")
        s.remove("C")
        for c in s:
            if not c.islower():
                print("WA")
                exit()
        print("AC")
        exit()
print("WA")

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

Solution (Python):
S = input()

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

if S[1].isupper():
    print("WA")
    exit()

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

ok = False
for i in range(2, len(S) - 1):
    if S[i].isupper():
        if ok:
            print("WA")
            exit()
        else:
            ok = True
if ok is False:
    print("WA")
else:
    print("AC")

Solution (Python):
S = input()

if S[0] != "A":
  print("WA")
  exit()
if S[1] == "C":
  print("WA")
  exit() 
if S[-1] == "C":
  print("WA")
  exit() 
if "C" not in S:
  print("WA")
  exit()
x = S.index("C")
if "C" in S[x+1:]:
  print("WA")
  exit()
if S[1:x]+S[x+1:] != (S[1:x]+S[x+1:]).lower():
  print("WA")
  exit()

print("AC")

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

Solution (Python):
s = input()
s1 = s[0]
s2 = s[2:-1]
s = s.replace('A','')
s = s.replace('C','')
t = s.lower()
if(s1 == 'A' and s2.count('C') == 1 and t == s):
    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','').islower():
    print('AC')
else:
    print('WA')

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

Solution (Python):

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

S = sr()
bl = True
if S[0] != 'A':
    bl = False
if S[2:-1].count('C') != 1:
    bl = False
if S.count('C') != 1:
    bl = False
for s in S[1:]:
    if s == 'C':
        continue
    if not s.islower():
        bl = False    

print('AC' if bl else '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()
print("AC" if "A" in S and "C" in S[2:-1] and S[1:].replace("C", "", 1).islower() else "WA")

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = 10**18


s = S()
if s[0] == 'A' and s[2:-1].count('C') == 1:
    t = list(s[1:])
    t.remove('C')
    if all(x.islower() for x in t):
        print('AC')
        exit()

print('WA')