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()
Count = 0

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

else:
    if S[1].isupper() or S[-1].isupper():
        print('WA')
    else:
        for i in S[2:]:
            if i.isupper():
                if Count==0 and i == 'C':
                    Count += 1
                else:
                    print('WA')
                    exit()
        if Count == 1:
            print('AC')
        else:
            print('WA')

Solution (Python):
s=input()
s2=s.replace("A","").replace("C","")
print("WAAC"[s2==s2.lower()and s[0]=="A"and s[2:-1].count("C")==1::2])

Solution (Python):
S = list(input())
syo = 'abcdefghijklmnopqrstuvwxyz'
syo = list(syo)
check = 0
if S[0] == 'A':
    pass
else:
    check = 1

tmp = S[2:-1]
if tmp.count('C') == 1:
    iii = S.index('C')
    for i in range(len(S)):
        if i == 0 or i == iii:
            pass
        else:
            if S[i] in syo:
                pass
            else:
                check = 1
else:
    check = 1



if check == 0:
    print('AC')
else:
    print('WA')

Solution (Python):
S = input()
ac = 1
if S[0] != 'A':
    ac = 0
c = 0
for i in range(1,len(S)):
    if 2 <= i <= (len(S) - 2) and S[i] == 'C':
        c += 1
        continue
    if S[i].isupper():
        ac = 0
if c == 1 and ac:
    print('AC')
else:
    print('WA')

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

from collections import Counter

S = input()
if S[0] == 'A':
    t = Counter(S[2:-1])
    if t['C'] == 1:
        S=S.replace('A', '')
        S=S.replace('C', '')
        if S.islower():
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Solution (Python):
S = input()

c = 0
for i in S:
    if i.isupper():
        c += 1

if S[0] != 'A' or S[-1].isupper() or c != 2 or 'C' not in S[2:-1]:
    print('WA')
else:
    print('AC')

Solution (Python):
S = input()

if S[0] != 'A' or S[-1].isupper():
    print('WA')
    exit()

c = 0
for i in S:
    if i.isupper():
        c += 1

S = S[2:-1]

if c == 2:
    if 'C' in S:
        print('AC')
        exit()

print('WA')

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

flag = 0
if S[0] == "A":
    s = S[2:N-1]
    if s.count("C") == 1:
        x = S.index("C")
        s1 = S[1:x]
        s2 = S[x+1:]
        S = s1+s2
        if S.islower():
            flag = 1
        else:
            flag = 0
if flag == 1:
    print("AC")
else:
    print("WA")

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

if "A" ==s[0] and "C" in s[2:l-1]:
    cnt=0
    for i in list(s):
        if i.isupper():
            cnt+=1

    if cnt==2:
        print("AC")
        exit()
print("WA")

Solution (Python):
S = list(input())
isConditionA = S[0] == 'A'
C_count = S[2:len(S) - 1].count('C')
memo = -1
for i in range(0, len(S)):
    if S[i] == 'C' and 1 < i < len(S) - 1:
        memo = i
if memo != -1:
    S.pop(memo)

S.pop(0)


if isConditionA and C_count == 1 and ''.join(S).islower():
    print('AC')
else:
    print('WA')

Solution (Python):
S=input()
ans="WA"
if S[0]=="A" and S[2:-1].count("C")==1:
  s=S.find("C",2,-1)
  S=S[1:s]+S[s+1:]
  if S.islower() is True:
    ans="AC"
print(ans)

Solution (Python):
S=input()
ans="WA"
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:
    ans="AC"
print(ans)

Solution (Python):
S=input()
ans="WA"
for i in range(len(S)):
  if S[i]=="A" and S[2:-1].count("C")==1:
    s=S.find("C",2,-1)-1
    SS=S[1:]
    SS=SS[:s]+SS[s+1:]
    if SS.islower() is True:
      ans="AC"
      break
print(ans)

Solution (Python):
s = input()

ans = True
if s[0] == 'A' and s[1].islower() and s[-1].islower() and s[2:len(s) - 1].count('C') == 1:
    for i in range(2, len(s) - 1):
        if s[i].isupper() and s[i] != 'C':
            ans = False
else:
    ans = False

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

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

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

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

C_index = None
for i, s in enumerate(S[2:-1], 2):
    if s == "C":
        C_index = i
        break

for i, s in enumerate(S[1:], 1):
    if i == C_index:
        continue

    if s.isupper():
        print("WA")
        exit()
print("AC")

Solution (Python):
S = input()

editS = S[2:-1:]

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

Solution (Python):
s = list(input())
a = [False, False, False]
count = 0
count1 = 0
if s[0] == "A":
  a[0] = True
for i in s[2:-1]:
  
  if i == "C":
    count += 1

if count == 1:
  a[1] = True
for j in range(len(s)):
  if s[j].islower():
    count1 += 1

if count1 == len(s)-2:
  a[2] = True

if all(a):
  print("AC")
else:
  print("WA")

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

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

Solution (Python):
def check1(s):
    return s[0]=='A'

def check2(s):
    co=0
    for i in s[2:-1]:
        if i=='C':
            co+=1
    return co==1

def check3(s):
    ju=True
    for i in s:
        if i.isupper():
            if i!='A' and i!='C':
                ju=False
                break
    return ju

s=input()
if check1(s) and check2(s) and check3(s):
    print('AC')
else:
    print('WA')

Solution (Python):
s = input()
subs = s[2:-1]

if s[0] == 'A' and subs.count('C') == 1:
    for char in s[1:]:
        if char.isupper() and char != 'C':
            break
    else:
        print("AC")
        exit(0)

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').islower()):
    print('AC')
else:
    print('WA')

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
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()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()

if S[0] == "A":
	for i in range(2, len(S)-1):
		if S[i] == "C":
			num = i
			s = S[1:num] + S[num+1:]
			if s.islower():
				print("AC")
				os.sys.exit()
print("WA")

Solution (Python):
S = input()
count = 0
ans = "WA"
L = []
for k in range(len(S)):
    L.append(S[k])

if L[0] == "A":
    for i in range(2,len(L)-1):
        if L[i] == "C":
            count += 1
            c = i
    if count == 1:
        count2 = 0
        for j in range(len(L)):
            if L[j].islower():
                count2 += 1
        if count2 == len(L)-2:
            ans = "AC"
print(ans)

Solution (Python):
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    s = list(input())

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

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

    idx = s[2:-1].index("C") + 2
    l =  s[1: idx] + s[idx+1:]
    for e in l:
        if e.isupper():
            print("WA")
            exit()

    print("AC")

Solution (Python):
s = input()

can = True
if s[0] != "A":
    can = False
else:
    cntc = 0
    for c in s[2:-1]:
        if c == "C":
            cntc += 1
    if cntc != 1:
        can = False
    else:
        cntup = 0
        for c in s:
            if c.isupper():
                cntup += 1
        if cntup != 2:
            can = False

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

Solution (Python):
a = input()
cIsExist = False

for i in range(len(a)):
    if i == 0:
        if a[i] != "A":
            print("WA")
            exit()
    elif 2 <= i <= len(a)-2:
        if a[i] == "C":
            if not cIsExist:
                cIsExist = not cIsExist
            else:
                print("WA")
                exit()
        else:
            if a[i] != a[i].lower():
                print("WA")
                exit()
    else:
        if a[i] != a[i].lower():
            print("WA")
            exit()
if cIsExist:
    print("AC")
else:
    print("WA")

Solution (Python):
s = input()
if s[0] == "A":
  if "C" in s[2:-1]:
    p = s.lstrip("A").split("C")
    if len(p) == 2:
      if p[0].lower() == p[0]:
        if p[1].lower() == p[1]:
          print("AC")
          quit()
print("WA")

Solution (Python):
import re
p = re.compile("^A[a-z][a-z]*C[a-z]+$")
s = input()
print("AC" if p.match(s) is not None else "WA")

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

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

if s[0] == "A" and "C" in s[2:l-1]:
    ans = 0
    for i in s:
        ans += i.isupper()

    if ans == 2:
        print("AC")
        exit()
print("WA")

Solution (Python):
S = input()

length = len(S)

pS1 = S[2: length-1]

if S.startswith('A') and "C" in pS1 and sum(S[i].isupper() for i in range(len(S)))==2:
    print('AC')
else:
    print('WA')

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

if s[0]=="A":
    for i in s[2:-1]:
        if i=="C":
            s.sort()
            if s[2].islower():
                print("AC")
                exit()

print("WA")

Solution (Python):
s = input()

def validation(s):
    if s[0] != "A":
        return "WA "
    s = s[1:]
    if s[1:-1].count("C") != 1:
        return "WA "
    c = 0
    for i in s:
        if i.islower() != True:
            c += 1
    if c != 1:
        return "WA "
    return "AC"

print(validation(s))

Solution (Python):
a = input()
b = 0
if a[0] != "A":
    print("WA")
    exit()
for i in range(2,len(a)-1):
    if b == 0 and a[i] == "C":
        b = i
    elif b != 0 and [i] == "C":
        print("WA")
        exit()
if b == 0:
    print("WA")
    exit()
for i in range(len(a)):
    if i != 0 and i != b and a[i].isupper():
        print("WA")
        exit()
print("AC")

Solution (Python):



alpha = "BDEFGHIJKLMNOPQRSTUVWXYZ"
s = list(input())
if s[0] != 'A':
    print('WA')
    quit()
if s[2:-1].count('C')!= 1:
    print('WA')
    quit()
for i in range(len(s)):
    if s[i] in alpha:
        print('WA')
        quit()
    elif s[i] == 'A':
        if i != 0:
            print('WA')
            quit()
    elif s[i] == 'C':
        if 0 <= i < 2 or i == len(s)-1:
            print('WA')
            quit()
print('AC')

Solution (Python):
S = input()

alphabets = set(chr(ord('a')+x) for x in range(26))

bl1 = (S[0] == 'A')
bl2 = (S[2:-1].count('C') == 1)
bl3 = (set(S) - set('AC') <= alphabets)

answer = 'AC' if bl1 and bl2 and bl3 else 'WA'
print(answer)

Solution (Python):

S = list(input())
uppercase_cnt = 0
for s in S:
    if s.isupper():
        uppercase_cnt += 1 
if S[0] != 'A':
    print('WA')
elif S[2:-1].count('C') != 1:
    print('WA')
elif uppercase_cnt != 2:
    print('WA')
else:
    print('AC')

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

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

Solution (Python):
s = list(input())
flag = True
if s[0] != "A":
    flag = False
c = False
if s[1].isupper() and s[1] != "A" and s[1] != "C":
    flag = False
for i in range(len(s) - 3):
    if s[i + 2] == "C":
        if c:
            flag = False
        c = True
    else:
        if s[i + 2].isupper() and s[i + 2] != "A" and s[i + 2] != "C":
            flag = False

if s[-1].isupper() and s[-1] != "A" and s[-1] != "C":
    flag = False


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

Solution (Python):
s = list(input())
ans = 'AC'
tmp = [0]
if s[0] != 'A':
    ans = 'WA'
for i in range(2, len(s)-1):
    if s[i] == 'C':
        tmp.append(i)
if len(tmp) != 2:
    ans = 'WA'
for i in range(len(s)):
    if not i in tmp:
        if not s[i].islower():
            ans = 'WA'
    else:
        pass
print(ans)

Solution (Python):
S = input()
count = 0
exception = [0]
answer = "WA"

if S[0] == 'A' and S[2:-1].count('C') == 1:
    C = S.index('C')
    exception.append(C)

if len(exception) == 2:
    for j in range(len(S)):
        if j not in exception and S[j].islower():
            count += 1

if count == len(S)-2:
    answer = "AC"

print(answer)

Solution (Python):





s = input()

if s[0] == "A" and s[2:-1].count("C") == 1:
  ls = list(s)
  ls.remove("A")
  ls.remove("C")
  if str(ls).islower():
    print("AC")
    quit()
print("WA")

Solution (Python):
S = input()
cnt_C = 0
length = len(S)
for i, s in enumerate(S):
    if i == 0 and s != "A":
        print("WA")
        exit()
    elif 2 <= i < length - 1:
        if s == "C":
            cnt_C += 1

    if not (s == "A" or s == "C" or "a" <= s <= "z"):
        print("WA")
        exit()

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

print("AC")

Solution (Python):
s = list(str(input()))
l = len(s)
if s[0]=="A" and "C" in s[2:l-1]:
    ans=0
    for i in s:
        ans+= i.isupper()
    if ans ==2:
        print("AC")
        exit()
print("WA")

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

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

res='WA'
cnt=0
cnt2=0

if s[0]=='A':
	for i in range(2,n-1):
		if s[i]=='C':
			cnt+=1
	for i in range(1,n):
		if s[i].isupper() and s[i]!='C':
			cnt2+=1
	if cnt==1 and cnt2==0:
		res='AC'
        
print(res)

Solution (Python):
def solve(s):
    if s[0] != "A":
        return False

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

    i = 2 + s[2:-1].index("C")
    t = s[1:i] + s[i + 1 :]
    return t == t.lower()


s = input()
print("AC" if solve(s) else "WA")

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

Solution (Python):
s = input()
if s[0] == 'A':
    s = s[1:]
    if s[1:-1].count('C') == 1:
        for char in s:
            if char != 'C' and char == char.upper():
                break
        else:
            print('AC')
            exit()
print('WA')

Solution (Python):
s = input()

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

Solution (Python):
s = input()
num_cap = len([i for i in s if i.isupper()])
indC = s.find("C")
print("AC") if num_cap == 2 and s.count("A") == 1 and s.count("C") == 1 and s[0] == "A" and 2 <= indC <= len(s)-2 else print("WA")

Solution (Python):
import sys
s=input()
l=[]
for i in range(2,len(s)-1):
    l.append(s[i])
if l.count("C")!=1:
    print("WA")
    sys.exit()
else:
    k=s[1:s.index("C")]+s[s.index("C")+1:]

if s[0]=="A" and l.count("C")==1 and k==k.lower():
    print("AC")
else:
    print("WA")

Solution (Python):



S = input()
counter = 0
flag = 0

if S[0] == "A":
    if S.find("C", 2, len(S) - 1) != -1:
        counter = S.find("C", 2, len(S) - 1)
        if S[1:counter] == S[1:counter].lower() and S[counter + 1 ::] == S[counter + 1 ::].lower():
            print("AC")
            flag = 1

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

Solution (Python):
s = input()

if len(s) >= 4 and len(s) <= 10 and s[0]=="A" and s[2:-1].count("C")==1:
    try:
        ss = list(s[2:-1])
        ss.remove("C")
        ss += s[-1]
        if s[1].islower() and ''.join(ss).islower():
            print("AC")
        else:
            print("WA")
    except:
        print("WA")
else:
    print("WA")

Solution (Python):
string = input()

strlist = list(string)
if strlist[0] != 'A':
	print('WA')
else:
	if 'C' not in strlist[2:-1]:
		print('WA')
	else:
		countA = strlist.count('A')
		countC = strlist.count('C')
		if countA == 1 or countC == 1:
			strlist.remove('A')
			strlist.remove('C')
			string1 = ''.join(strlist)
			if string1.islower():
				print('AC')
			else:
				print('WA')
		else:
			print('WA')

Solution (Python):
line = input()
WA_flag = 0
C_flag = 0
check_point = 0

for cnt, elm in enumerate(line):
    if cnt == 0:
        if elm != "A":
            WA_flag += 1
            
    if cnt > 1 and cnt < (len(line) - 1):
        if elm =="C":
            C_flag += 1
            check_point = cnt

if C_flag != 1:
    WA_flag += 1
    
else:
    for cnt, elm in enumerate(line):
        if cnt != 0 and cnt != check_point:
            if elm.isupper():
                WA_flag += 1
                

if WA_flag != 0:
    print("WA")
else:
    print("AC")

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

if s[0] != "A":
    print("WA")
    exit()
if s[2:-1].count("C") != 1:
    print("WA")
    exit()
for t in s:
    if t.isupper() and t != "A" and t != "C":
        print("WA")
        exit()

print("AC")

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

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

Solution (Python):
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

S = s()

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

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

if c_count != 1:
    print('WA')
    sys.exit()

for i in range(len(S)):
    if i == 0 or i == c_index:
        continue
    if S[i].upper() == S[i]:
        print('WA')
        sys.exit()

print('AC')

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

Solution (Python):
S = input()
flag = True
if S[0] != "A":
    flag = False
s_n = S[2:-1]
c_c = 0
ci = 0
for i,si in enumerate(s_n):
    if si == "C":
        ci = i+2
        c_c += 1

if c_c != 1:
    flag = False

for i,si in enumerate(S):
    if i == 0 or i == ci:
        continue
    if not si.islower():
        flag = False

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

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

Solution (Python):
s = input()

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

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

count=0
for ch in s:
    if not ('a' <= ch <= 'z'):
        count += 1
print('WA' if count-2!=0 else 'AC')

Solution (Python):

ans = "WA"
s = list(input())
if s[0] == "A":
  if s[2:-1].count("C") == 1:
    c = s[2:-1].index("C")+2

    if all([ s[i].islower() for i in range(1,len(s)) if i != c]):
      ans = "AC"

print(ans)

Solution (Python):



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

Solution (Python):
def abc():
    s = input().rstrip()
    if s[0] != 'A':
        print('WA')
        return
    if s[2:-1].count('C') != 1:
        print('WA')
        return
    trimed = s.replace('A', '').replace('C', '')
    if trimed != trimed.lower():
        print('WA')
        return

    print('AC')


abc()

Solution (Python):

S = input()

FA = False
FB = False
FC = True
BC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

if S[0] == "A":
    FA = True

cnum = 0

for i in range(len(S)):

    if ( 2 <= i ) and ( i <= len(S)-2 ) and S[i] == "C" :
        cnum += 1

    elif i != 0 and ( S[i] in BC ):

        FC = False


if cnum == 1:
    FB = True


if FA and FB and FC:
    print ("AC")

else:
    print ("WA")

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

Solution (Python):
S = input()
ss = list('abcdefghijklmnopqrstuvwxyz')

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

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

Solution (Python):
S = input()

WA = "WA"

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

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

C_cnt = 0
for i in range(2, len(S) - 1):
    if S[i] == 'C':
        if C_cnt == 0:
            C_cnt += 1
            continue
        else:
            print(WA)
            exit()
    else:
        if S[i].isupper():
            print(WA)
            exit()

if C_cnt == 0:
    print(WA)
    exit()

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

print("AC")

Solution (Python):
s = input()
lowercase = [chr(ord('a') + i) for i in range(26)]


ans = 'AC'
c_count = 0
for i in range(len(s)):
  yet = True
  if i == 0:
    yet = False
    if s[i] != 'A':
      ans = 'WA'
      break
  if yet and 2 <= i <= len(s) - 2:
    if s[i] == 'C':
      yet = False
      c_count += 1
        
  if yet:
      if not s[i] in lowercase:
        ans = 'WA'
        break
if c_count != 1:
  ans = 'WA'
  
print(ans)

Solution (Python):
s = input()

if s[0] == 'A' and s[2:-1].count('C') == 1 and sum(x.isupper() for x in s) == 2:
  print('AC')
else:
  print('WA')

Solution (Python):
S = input()

alphabets = set(chr(ord('a')+x) for x in range(26))

bl1 = (S[0] == 'A')
bl2 = (S[2:-1].count('C') == 1)
bl3 = (set(S) - set('AC') <= alphabets)

answer = 'AC' if bl1 and bl2 and bl3 else 'WA'
print(answer)

Solution (Python):
n = input()

result = "AC"
if n[0] != "A":
        result = "WA"
        print(result)
        quit()

carea = n[2:-1]
ccount = 0
for i in carea:
        if i == "C":
                ccount += 1
if ccount >= 2 or ccount == 0:
        result = "WA"
        print(result)
        quit()

for i in carea:
        if i == "A":
                result = "WA"
                print(result)
                quit()

if n[-1] == "C" or n[-1] == "A":
        result = "WA"
        print(result)
        quit()

if n[1] == "C" or n[1] == "A":
        result = "WA"
        print(result)
        quit()


for i in n:
        if i.isupper() == True:
                if i not in "AC":
                        result = "WA"
                        print(result)
                        quit()
print(result)

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

ans = 'AC'

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

cnt = 0
for i in range(1, n):
    if S[i] == 'C' and (i >= 2 and i <= n-2):
        cnt += 1
    elif S[i] >= 'a' and S[i] <= 'z':
        continue
    else:
        ans = 'WA'
if cnt != 1:
    ans = 'WA'

print(ans)

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

Solution (Python):
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

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

sys.setrecursionlimit(2147483647)
INF = float("inf")

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

ok = True
ok &= S[0] == 'A'
ok &= S[2:-1].count('C') == 1

if ok:
    orig = S
    cs = list(S.lower())
    cs[0] = 'A'
    cs[S.index('C')] = 'C'

    ok &= S == ''.join(cs)
    if ok:
        print('AC')
    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', 'c').islower():
  print("AC")
else:
  print("WA")

Solution (Python):
S = input()
flg = 0
if S[0] == 'A':
    flg += 1
if S[1].isupper():
    flg += 1000
for i in range(2, len(S)-1):
    if S[i] == 'C':
        flg += 10
    elif S[i].isupper():
        flg += 1000
if S[-1].isupper():
    flg += 1000
if flg == 11:
    print('AC')
else:
    print('WA')

Solution (Python):
S = input()

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

Solution (Python):
s = input()

fa = (s[0] == 'A')

cntC = 0
fc = True
for i in range(2, len(s)-1):
    if s[i] == 'C':
        cntC += 1
    elif s[i].isupper():
        fc = False
if s[1].isupper() or s[-1].isupper():
    fc = False

fb = (cntC == 1)

if fa and fb and fc:
    print("AC")
else:
    print("WA")

Solution (Python):

a = input()



answer = ""

if(a[0] != "A"):
  answer = "WA"
else:
  a_list = list(a)
  b_list = a[2:-1]
  if (not b_list.count("C") == 1):
    answer = "WA"
  else:
    c = a[1:]
    c_index = c.find("C")
    c_list = list(c)
    c_list.pop(c_index)
    c_join = "".join(c_list)

    if(c_join.islower()):
      answer = "AC"
    else:
      answer = "WA"


print(answer)

Solution (Python):
S = input()

count = 0
if S[0] == 'A' and 'C' in S[2: -1]:
    for v in S:
        if v.isupper():
            count += 1

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

Solution (Python):
s = input()
if s[0] != "A":
  print("WA")
  exit()
if  s.find("C") < 2 or s.find("C") == len(s)-1:
  print("WA")
  exit()
if s.count("C") != 1:
  print("WA")
  exit()
s = s.replace("A","",1)
s = s.replace("C","")
if s != s.lower():
  print("WA")
  exit()
print("AC")

Solution (Python):
S= input()

if S[0] != 'A':
    print('WA')
    exit()
if S[2:-1].count('C') !=1:
    print('WA')
    exit()
C_posi = S[2:-1].index('C')+2

SS = S[1:C_posi] + S[C_posi+1:]

if SS.islower() == False:
    print('WA')
    exit()

print('AC')

Solution (Python):
S = [s for s in input()]

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

Solution (Python):
def priwa():
    print('WA')



s = list(input())

if s[0] == 'A':
    s.pop(0)
    if s[0].islower() == True:
        s.pop(0)
        if s[0:len(s)-1].count('C') == 1:
            s.remove('C')
            for i in s:
                if i.islower() == False:
                    priwa()
                    exit()
            print('AC')
        else:
            priwa()
    else:
        priwa()
else:
    priwa()

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

a = [chr(i) for i in range(97, 97+26)]
A = [chr(i) for i in range(65, 65+26)]

flg = "AC"

if not s[0] == "A":
    flg = "WA"

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

b = set(s)-set(["A","C"])

if not b<=set(a):
    flg = "WA"

print(flg)

Solution (Python):
S = input()

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

Solution (Python):
import re
S = input()
if not S[0] == 'A':
    print('WA')
elif len(S) > 4 and S[2:-1].count('C') != 1:
    print('WA')
elif len(S) == 4 and S[2:].count('C') != 1:
    print('WA')
elif len(re.findall('[A-Z]', S)) != 2:
    print('WA')
else:
    print('AC')

Solution (Python):




s = input()


if s[0] == "A" and s[1].islower() == True and s[len(s)-1].islower() == True:
    ccnt = 0
    bflg = False
    for i in range(2, len(s)-1):
        if s[i] == "C":
            ccnt += 1
        elif s[i].islower() == False:
            bflg = True
            break
        if bflg == False and ccnt == 1:
            ans = "AC"
        else:
            ans = "WA"
else:
    ans = "WA"


print(ans)

Solution (Python):
S=input()
S1=list(str(s)  for s in S)
A=1
B1=0
B2=0
C=1
if S1[0] != 'A':
  A=0
  
for s in S1[2:-1]:
  if s=='C':
    B1=1
    B2+=1

for s in S1[1::]:
  if s=='C':
    pass
  elif s.isupper():
    C=0
    
if A==1 and B1==1 and B2==1 and C==1:
    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()
Slist = list(S)
L = len(S)
if S[0] == 'A' and 'C' in S[2:L-1] and Slist.count('C') == 1:
    Slist.remove('A')
    Slist.remove('C') 
    flag = True
    for s in Slist:
        if s.isupper():
            flag = False
    if flag:
        print('AC')
        exit()
print('WA')

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

Solution (Python):
import copy
s = list(input())
Ccnt = 0
if s[0] == 'A' :
	for i in copy.copy(s[2:-1]) :
		if i == 'C' :
			Ccnt += 1
			s.remove(i)
	s.remove(s[0])
	if Ccnt == 1 and ''.join(s) == ''.join(s).lower() :
		print('AC')
		exit()
print('WA')