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()
if s[0] == "A" and s[2:(len(s)-1)].count("C") == 1 and sum([1 for i in s if i.isupper()]) == 2:
    print("AC")
else:
    print("WA")

Solution (Python):
s = list(str(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] == 'A' or s[i] == 'C':
        pass
    else:
        if s[i].islower():
            pass
        else:
            flag = False
if flag:
    print('AC')
else:
    print('WA')

Solution (Python):




def main():
    S = input()

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


if __name__ == "__main__":
    main()

Solution (Python):
f=True
s=input()
if s[0]!="A":f=False
if s.count("C")==0 or s.count("C")>=2:f=False
else:
    i=s.index("C")
    if i==1 or i==len(s)-1:f=False
    else:
        for x in range(len(s)):
            if x==i or x==0:continue
            if s[x].isupper():f=False
if f:print("AC")
else:print("WA")

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

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

for i in range(0, len(s)):
  if(s[i].isupper()):
    t = t + 1
  else:
    pass

try:
  if 2 <= s.index('C') and s.index('C') <= len(s)-2 and s.index('A')==0:
    if t == 2:
      print('AC')
    else:
      print('WA')
  else:
    print('WA')

except ValueError:
  print('WA')

Solution (Python):
def input_int():
    return map(int, input().split())

def input_int():
    return int(input())

def one_str():
    return input()

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

S=one_str()

flg = False
if S[0]=="A":
    if "C" in S[2:-1]:
        indC = S[2:-1].index("C")+2
        ss = S[1:indC] + S[indC+1:]
        if ss.islower():
            flg =True

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

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


if __name__ == '__main__':
    main()

Solution (Python):
S=input()
if S[0]=='A' and S[2:-1].count('C')==1:
    s=list(S)
    s.remove('C')
    S=''.join(s)
    if S.istitle()==True:
        print('AC')
        exit()
print('WA')

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

Solution (Python):
S=input()

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

count=0
for i in range(2,len(S)-1):
  if S[i]=='C':
    count+=1
if count!=1:
  print('WA')
  exit()

for i in range(2,len(S)-1):
  if S[i]=='C':
    break

S=S[1]+S[2:i]+S[i+1:len(S)]

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

Solution (Python):
s = input()

ans = "AC"

if s[0] != "A":
  ans = "WA"

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

if not s.replace("C","c")[1:].islower():
  ans = "WA"

print(ans)

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

f=0
if S[0]=="A":
    f+=1
    
if S.count("C")==1:
    f+=10
    
if S.count("A")==1:
    f+=100
    
for i in range(N):
    if S[i]=="C":
        if i>=2 and i<=N-2:
            f+=1000
            break

Uc=0        
for i in range(N):
    if S[i]==S[i].upper():
        Uc+=1
        
if Uc==2:
    f+=10000
    
if f==11111:
    print("AC")
else:
    print("WA")

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

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

Solution (Python):
S=input()
if S[0]=='A' and S[2:-1].count('C')==1:
    s=list(S)
    s.remove('C')
    S=''.join(s)
    if S.istitle()==True:
        print('AC')
        exit()
print('WA')

Solution (Python):
word=input()
cflg=True
if word[0]!='A':
  cflg=False
elif word[2:-1].count('C')!=1:
  cflg=False
cnt=0
for l in word[1:]:
  if l.isupper():
    cnt+=1
else:
  if cnt!=1:
    cflg=False
  
if cflg:
  print('AC')
else:
  print('WA')

Solution (Python):
S = input()

def stringChecker(S):
    if S[0] != 'A':
        return False
    cnt = 0
    for l in S[2:-1]:
        if l == 'C':
            cnt += 1
    if cnt != 1:
        return False
    
    lower_cnt = 0
    for l in S:
        if l.islower():
            lower_cnt += 1
    if lower_cnt != len(S) - 2:
        return False
    
    return True
if stringChecker(S):
    print('AC')
else :
    print('WA')

Solution (Python):



l = list(input())
m = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')

x = 0
for j in l:
    if j in m:
        x += 1

a = 0
for i in range(2,len(l)-1):
    if l[i] == 'C':
        a += 1
if a == 1 and l[0] == 'A' and x == 2:
    print('AC')
else:
    print('WA')

Solution (Python):


l = list(input())

m = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')


x = 0
for j in l:
    if j in m:
        x += 1

a = 0
for i in range(2,len(l)-1):
    if l[i] == 'C':
        a += 1
if a == 1 and l[0] == 'A' and x == 2:
    print('AC')
else:
    print('WA')

Solution (Python):
inp = input()






if inp.startswith("A") and inp[2:len(inp)-1].count("C") ==  1 and inp[1:inp.find("C", 0, len(inp) - 1)] == inp[1:inp.find("C", 0, len(inp) - 1)].lower() and inp[inp.find("C", 0, len(inp) - 1) + 1:len(inp)] == inp[inp.find("C", 0, len(inp) - 1) + 1:len(inp)].lower():
  print("AC")
else:
  print("WA")

Solution (Python):
s=input()

p=s[0]=="A" and s[2:-1].count("C")==1
q=(s[1]+s[2:-1].replace("C","c")+s[-1]).islower()
ans=p and q
print("AC" if ans is True else "WA")

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

Solution (Python):
S = input()
if S[0] != 'A':
    print("WA")
elif ord(S[1]) < 97:
    print('WA')
elif ord(S[-1]) < 97:
    print("WA")
else:
    cnt = 0
    for i in range(1, len(S)-1):
        if S[i] == 'C':
            cnt += 1
    if cnt == 1:
        print("AC")
    else:
        print("WA")

Solution (Python):
import  re
s = input()
print(s[0] == "A" and s[2:-1:].count("C") ==1 and len(re.findall("[a-z]",s)) == len(s)-2 \
        and "AC" or "WA")

Solution (Python):
s = input()

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

Solution (Python):
s = input()

t = 'a'
for i in range(1, len(s)):
    if s[i] == 'C':
        t += 'c'
    else:
        t += s[i]

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

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

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

count = 0
for i in s[2:-1]:
    if i == "C":
        count += 1
if count != 1:
    flg = False

n = 0
for i in s:
    if i.isupper():
        n += 1
if n != 2:
    flg = False

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

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

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

if length == 4:
    if s[2] == 'C':
        cnt = 1
else:
    for i in range(2, length-1):
        cnt += 1 if s[i] == 'C' else 0

if cnt != 1:
    print('WA')
    exit()

up_cnt = 0
for c in s:
    if c.isupper():
        up_cnt += 1

if up_cnt != 2:
    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()
lower = "qwertyuiopasdfghjklzxcvbnm"
no = False
if s[0] != "A":
  no = True
if s[2:len(s)-1].count("C") != 1:
  no = True
if no:
  print("WA")
  exit()
ls = list(s)
ls.pop(ls.index("A"))
ls.pop(ls.index("C"))
sls = ""
for lsi in ls:
  sls += lsi
if sls != sls.lower():
  print("WA")
  exit()
print("AC")

Solution (Python):
import numpy as np

def main():

    test = input()
    if test[0] != "A":
        print("WA")
        return

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

    for i in range(len(test)):
        if i == 0 and test[i] == "A": continue
        if 2 <= i <= len(test) - 2 and test[i] == "C": continue

        if test[i].lower() != test[i]:
            print("WA")
            return

    print("AC")







if __name__ == "__main__":
    main()

Solution (Python):
from collections import Counter
S = input()
def lower_s(string):
    big_c = 0
    for c in string[1:]:
        if c == "C":
            if big_c == 1:
                return False
            else:
                big_c = 1
                continue
        if c == c.upper():
            return False
    return True
if (S[0] == "A") and (Counter(S[2:-1])["C"] == 1) and lower_s(S):
    print("AC")
else:
    print("WA")

Solution (Python):
S = input()
flag = False
cflag = False
count = 0
cnum = -1
for i in range(len(S)):
    if 2 <= i:
        if i <= (len(S)-2):
            if S[i] == "C":
                count += 1
                cnum = i
            if count == 1:
                cflag = True

if S[0] == "A":
    if cflag:
        flag = True
        for i in range(len(S)):
            if i != 0:
                if i != cnum:
                    a = ord(S[i])
                    if a <= 90:
                        flag = False
if flag:
    print("AC")
else:
    print("WA")

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

if s[0] == 'A':
  if s[2:-1].count('C') == 1:
    for i in range(1, len(s)):
      if 97 <= ord(s[i]) <= 122:
        continue
      else:
        count_c += 1
      if count_c > 1:
        print("WA")
  else:
    print("WA")
else:
  print("WA")

if count_c == 1:
  print("AC")

Solution (Python):
alf = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
s = input()
if s[0] != 'A':
  print('WA')
  exit()
cnt = 0
pos = 0
for i,c in enumerate(s[2:-1]):
  if c == 'C':
    cnt += 1
    pos = i+2
if cnt != 1:
  print('WA')
  exit()
for i,c in enumerate(s[1:]):
  if i+1 != pos and c in alf:
    print('WA')
    break
else:
  print('AC')

Solution (Python):
import sys

s=input()
c_count=0
flag=False


for ss in s:
    if ss.isupper():
        if ss!='A' and ss!='C':
            print('WA')
            sys.exit()

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

if c_count==1:
    flag=True

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

Solution (Python):
s = input()

if s[0] != 'A' or s[2:-1].count('C') != 1:
  print('WA')
else:
  for i,c in enumerate(s):
    if i == 0 or i>1 and c == 'C':
      continue
    else:
      if not 'a'<=c<='z':
        print('WA')
        break
  else:
    print('AC')

Solution (Python):
import re

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

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

count=0
for i in range(2,len(s[2:])+1):
	if s[i]=='C':
		count+=1
		c=i
if count!=1:
	print("WA")
	sys.exit()
s=s.replace(s[c],'')
s=s.replace(s[0],'')
if not s.islower():
	print("WA")
	sys.exit()

print("AC")

Solution (Python):
S=input()
s=""
flag=1
Cflag=1
if not(S[0]=="A"):
    flag=0
s="".join((s,S[1],S[len(S)-1]))

S2=S[2:len(S)-1]

for i in range(len(S2)):
    if not(S2[i]=="C"):
        s="".join((s,S2[i]))
    else:
        Cflag=Cflag-1
if not(Cflag==0):
    flag=0
if s.islower()==False:
    flag=0


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

Solution (Python):
s=input()
x=0
ans="WA"
if s[0]=="A":
  if s[2:-1].count("C")==1:
    x=s[2:-1].find("C")+2
    t=s[1:x]+s[x+1:]
    if t.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=str(input())
can=int(1)

if s[0]!='A':
    can=0

count=int(0)
big=int(0)

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

if count!=1:
    can=0

for i in range(1,len(s)):
    if i==big:
        continue

    if s[i].isupper():
        can=0

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

Solution (Python):
import re

def solve(s):
    return 'AC' if re.match('^A[a-z]+C[a-z]+$', s) else 'WA'

_s = input()
print(solve(_s))

Solution (Python):
S = list(map(str, input()))
flg = 1

if S[0] != "A":
	flg = 0

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

ctr = 0	
for s in S:
	if ord(s) <= 90:
		ctr += 1
if ctr != 2:
	flg = 0
	
	
if flg:
	print("AC")
else:
	print("WA")

Solution (Python):

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
s = input()

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

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

for i in range(len(s)):
    if s[i] in "AC": pass
    elif 97 <= ord(s[i]) <= 122: pass
    else: flag = 0
print("AC" if flag else "WA")

Solution (Python):

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
s = input()
if s[0] != "A": print("WA")
elif s[2:-1].count("C") != 1: print("WA")
else:
    for i in range(len(s)):
        if s[i] in "AC": pass
        elif 97 <= ord(s[i]) <= 122: pass
        else:
            print("WA")
            exit(0)
    print("AC")

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

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

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

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

Solution (Python):
"""
author : halo2halo
date : 23, Jan, 2020
"""

import sys




read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

S = list(readline().decode('utf8').rstrip())
bl = S[0] == 'A'
bl &= ('C' in S[2:-1])

if bl:
    S.remove('A')
    S.remove('C')

bl &= all('a' <= x <= 'z' for x in S)

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

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

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' and s[2:-1].count('C') == 1 and all([ord('a') <= ord(c) <= ord('z') for c in s.replace('A', '').replace('C', '')]):
  print('AC')
else:
  print('WA')

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

Solution (Python):
s = input()

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

print("WA")

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

Solution (Python):
import sys

S = input()

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

print('WA')

Solution (Python):
S = input()
flag = True

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

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

c = 0
for s, s_lower in zip(S, S.lower()):
    if s != s_lower:
        c += 1

if c != 2:
    flag = False

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

Solution (Python):
from sys import exit

S = input()
if S[0] != 'A' or S[1].isupper() or S[-1].isupper():
    print('WA')
    exit()
c = 0
for s in S[2:-1]:
    if s == 'C':
        c += 1
    elif s.isupper():
        print('WA')
        exit()

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

Solution (Python):
s=input()
li = [s[i] for i in range(2,len(s)-1) if s[i] == "C"]
alphabet = [chr(i) for i in range(97, 97+26)]
if s[0] != "A" or len(li) != 1:
  print("WA")
else:
  for i in range(1,len(s)):
    if s[i]=="C" or s[i] in alphabet:
      continue
    else:
      print("WA")
      exit()
  print("AC")

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

Solution (Python):
S = input()

ans = "WA"
if S[0] == "A":
    if S[2:-1].count("C") == 1 and S.count("C") == 1:
        n = len(S)
        for i in range(len(S)):
            if S[i] == "A" or S[i] == "C":
                pass 
            elif S[i].isupper() == True:
                n -= 1
                break
        if n == len(S):
            ans = "AC"

print(ans)

Solution (Python):
s = input()

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

Solution (Python):
import re
s = input()
cnt = 0
if (s[2:-1].count('C') != 1):
    print('WA')
    exit(0)
for i in range(len(s)):
    if (s[i] >= 'A' and s[i] <= 'Z'):
        cnt += 1
        if (cnt >= 3):
            print('WA')
            exit(0)
print('AC') if s[0]=='A' else print('WA')

Solution (Python):
import string

S = input()
re_S = set(S)-set("AC")
bl = S[0] == "A"
bl &= (S[2:-1].count("C") == 1)
bl &= (re_S <= set(string.ascii_lowercase ))

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

Solution (Python):

s = list(str(input()))

flag = []
for i in range(3):
    flag.append(False)
small = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

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

if flag[0]:
    count1 = 0
    for i in range(2, len(s) - 1):
        if s[i] == 'C':
            count1 += 1
            tmp = i
    if count1 == 1:
        flag[1] = True

if flag[0] and flag[1]:
    count2 = 0
    for i in range(1, len(s)):
        if i != tmp and (s[i] in small):
            count2 += 1
    if count2 == len(s) - 2:
        flag[2] = True

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

Solution (Python):
import sys
from string import ascii_uppercase

INPUT = lambda: sys.stdin.readline().rstrip()

sys.setrecursionlimit(10 ** 9)


def main():
    S = INPUT()
    n = len(S)

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

    for i in range(2, n-1):
        if S[i] == 'C':
            idx = i
            break
    else:
        print("WA")
        sys.exit()

    for i in range(n):
        if i == 0 or i == idx: continue
        if S[i] in ascii_uppercase:
            print("WA")
            sys.exit()
    else:
        print("AC")

if __name__ == '__main__':
    main()

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

Solution (Python):
S = input()

ans = "WA"

if S[0] != "A":
  print(ans)
  
else:
  if S[2:len(S) - 1].count("C") != 1:
    print(ans)
  else:
    s = S.index("C")
    SS = S[1:s] + S[s + 1:]
    if SS.islower() == False:
      print(ans)
    else:
      print("AC")

Solution (Python):
s = input()
is_a = False
cnt_c = s[2:-1].count("C")
cnt_l = 0
if s[0] == "A":
    is_a = True
else:
    pass
for letter in s:
    if letter.isupper():
        cnt_l += 1
    else:
        continue
if is_a == True and cnt_c == 1 and cnt_l == 2:
    print("AC")
else:
    print("WA")

Solution (Python):
S = input()
AC = S[0]=='A' and S[2:-1].count('C')==1
for c in S[1:]:
    AC *= (c>='a' and c<='z') or c=='C'
print('AC' if AC else 'WA')

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

Solution (Python):
s = input()
letters = 'abcdefghijklmnopqrstuvwxyzAC'
print('AC' if s[0] == 'A' and s[2:-1].count('C') == 1 and all(c in letters for c in s) else 'WA')

Solution (Python):
def examA():
    R = I()
    if R<1200:
        ans = "ABC"
    elif R<2800:
        ans = "ARC"
    else:
        ans = "AGC"
    print(ans)
    return

def examB():
    S = SI(); N = len(S)
    ans = "AC"
    if not S[0]=="A":
        ans = "WA"
    flag = False
    for i in range(2,N-1):
        if S[i]=="C":
            flag = True
    if not flag:
        ans = "WA"
    num = 0
    for i in S:
        if ord("A")<=ord(i)<=ord('Z'):
            num +=1
    if not num==2:
        ans = "WA"
    print(ans)
    return

def examC():
    return

def examD():
    return

def examE():
    return

def examF():
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examB()

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

Solution (Python):
s = input()

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

t = s[2:-1]
if ('C' not in t or t.count('C') > 1):
   print('WA')
   exit()

s = s[1:]
s = s.replace('C', '')
for x in s:
   if (x.islower() == False):
      print('WA')
      exit()
print('AC')

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")
        if not "".join(ls).islower():
            flag = "WA"
        
            
                
print(flag)

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

Solution (Python):
S = list(input().strip())
flag = False

if S[0] == "A" and "C" in S[2:-1]:
    count = 0
    for s in S:
        
        if "A" <= s <= "Z":
            count += 1
    if count == 2:
        flag = True
if flag:
    print("AC")
else:
    print("WA")

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

ss = ""
count = 0
for i in range(2, len(s)-1):
    if s[i] == "C":
        count += 1
    else:
        ss += s[i]
sss = s[1]+ss+s[-1]
if count==1:
    if sss.islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")
    exit()

Solution (Python):
s = list(input())
ans = []
flag = 0
counter = 0
for i in range(len(s)):
    if (i == 0 and s[i] == "A"):
        ans.append(1)
        counter = 1
    elif (i == 0 and s[i] != "A" and s[i].isupper()):
        print("WA")
        exit()
    elif (2 <= i <= len(s) - 2 and s[i] == "C" and flag ==0):
        ans.append(1)
        flag = 1
        counter = 1
    elif (2 <= i <= len(s) - 2 and s[i] == "C" and flag == 1):
        print("WA")
        exit()
    elif (counter == 0 and s[i].isupper()):
        print("WA")
        exit()
    counter = 0
if (len(ans) == 2):
    print("AC")
else:
    print("WA")

Solution (Python):
S = input()


def judge(sent):
    tmp = sent[1]
    tmp_last = sent[-1]
    if sent[0] != 'A' or tmp.isupper() or tmp == 'C' or tmp_last.isupper() or tmp_last == 'C':
        return False

    part = list(sent[2:-1])
    if sum(['C' in s for s in part]) != 1:
        return False
    idx = part.index('C')
    part.pop(idx)
    if any([s.isupper() for s in part]):
        return False
    return True


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

Solution (Python):
S = input()
print("WAAC"[S[0]=="A" and S[2:-1].count("C")==1 and len(list(filter(str.isupper, S)))==2::2])

Solution (Python):
S = input()
flg = True
cnt = 0

for i, c in enumerate(S):
    if i == 0 and c != 'A':
        flg = False
    if i == 1:
        if c == 'C' or c.islower == False:
            flg = False
    if i > 0 and i != len(S) - 1:
        if c == 'C':
            cnt += 1
        elif c.islower() == False:
            flg = False
    if i == len(S) - 1:
        if c.islower() == False or c == 'C':
            flg = False

if cnt == 1 and flg == True:
    print('AC')
else:
    print('WA')

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

Solution (Python):
import sys
input = sys.stdin.readline
S = list(input().strip())
flag = False

if S[0] == "A" and "C" in S[2:-1]:
    count = 0
    for s in S:
        if s < "a":
            count += 1
    if count == 2:
        flag = True
if flag:
    print("AC")
else:
    print("WA")

Solution (Python):
A = list(input())
L = len(A)

ans = 'WA'
flag = 0
f = 0
j = 0

if A[0] == 'A':
    if A[0].isupper():
        flag = flag + 1

count = 0
i=2
while(1):
    if A[i] == 'C':
        if A[i].isupper():
            count = count + 1
    i = i + 1
    if (L-2-i < 0):
        break

if count == 1:
    flag = flag + 1

count = 0
for i in range(1,L):
    
    if A[i].isupper():
        count = count + 1

if count == 1:
    flag = flag + 1

if flag == 3:
    ans = 'AC'

print(ans)

Solution (Python):
from collections import Counter
s = input()
fist = s.replace('A', '').replace('C', '')

if not fist.islower():
    print('WA')
else:
    seco = s[2:-1]
    cnt = Counter(seco)
    if not cnt['C'] == 1:
        print('WA')
    else:
        if s[0] == 'A':
            print('AC')
        else:
            print('WA')

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

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

if s[2:-1].count('C') != 1:
    ans = 'WA'

cnt = 0
for i in s:
    
    if 'A' <= i <= 'Z':
        cnt += 1

if cnt != 2:
    ans = 'WA'

print(ans)

Solution (Python):
S = list(input())
last = len(S) - 1

S_head = S[0]

S_bothEnd = [S[0],S[1],S[last]]
S_center = list(set(S)-set(S_bothEnd))

S_clone = S
if "A" in S_clone:
  S_clone.remove('A')
if "C" in S_clone:
  S_clone.remove('C')

evalLow = "".join(S_clone)

if S_head == "A" and S_center.count("C")  == 1 and evalLow.islower() == 1:
  print('AC')
else:
  print('WA')

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

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


if s[0] == 'A':
    for i in range(2 , len(s)-1):
        
        if s[i] == "C" and count == 2:
            flag = 1
if flag == 1:
    print("AC")
else:
    print("WA")

Solution (Python):

def main():
    S = input().rstrip()
    flags = [S[0] == "A", S[2:-1].count("C") == 1, S.translate(str.maketrans({"A": None, "C": None})).islower()]
    print("AC" if all(flags) else "WA")


if __name__ == "__main__":
    main()

Solution (Python):





s = list(input())
ans = True
li = list("abcdefghijklmnopqrstuvwxyzC")

if s[0]!="A":
    ans = False
memo = s[2:-1]
if not("C" in memo):
    ans = False
C_cnt = 0
for i in range(1,len(s)):
    if not(s[i] in li):
        ans = False
    if s[i] == "C":
        C_cnt += 1

if ans and C_cnt==1:
    print("AC")
else:
    print("WA")

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

Solution (Python):
s=input()
ans="AC"
if s[0]!="A":
    ans="WA"
c=0
idx=0
for i in range(2,len(s)-1):
    if s[i]=="C":
        c+=1
        idx=i
if c!=1:
    ans="WA"
small={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"}
for i in range(1,len(s)):
    if i!=idx:
        if s[i] not in small:
            ans="WA"
            break
print(ans)

Solution (Python):
import re

S = input()
if S[0] != "A" or len(re.findall("C", S[2:-1])) != 1:
    print("WA")
    exit()

if len(re.findall("[A-Z]", S)) != 2:
    print("WA")
else:
    print("AC")

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

if s[0]!="A":
    print("WA")
    exit()
else:
    del s[0]
cnt=0
for i in range (1,len(s)-1):
    if s[i]=="C":
        cnt+=1
    
if cnt==1:
    del s[s.index("C")]
else:
    print("WA")
    exit()

for i in range(len(s)):
    if s[i].islower()==True:
        continue
    else:
        print("WA")
        exit()

print("AC")

Solution (Python):
import sys

s = input()

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

if s[1] < "a" or s[1] > "z":
    print("WA")
    sys.exit(0)


sub = s[2:-1]
has = False
for c in sub:
    if not has and c == "C":
        has = True

    elif "a" <= c <= "z":
        continue

    else:
        has = False
        break

if not has:
    print("WA")
    sys.exit(0)

if "a" <= s[-1] <= "z":
    print("AC")
else:
    print("WA")