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

ans = 'WA'
if s[0] == 'A' and s[2:len(s) - 1].count('C') == 1:
    i = s[2:len(s) - 1].find('C')
    if s[1:i + 2].islower() and s[i + 2 + 1:].islower():
        ans = 'AC'
print(ans)

Solution (Python):
s=input()
k="WA"
for i in range(2,len(s)-1):
    if s[0]=="A" and "C"==s[i] and s.count("C")==1 and sum([c.isupper() for c in s]) == 2:
        k="AC"
print(k)

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):
s=[i for i in input()]
a=0
if s[0]=="A":
    if s[2:-1].count("C")==1:
        s.remove("A")
        s.remove("C")
        S=[i.upper() for i in s]
        if set(S)&set(s)==set():
          a+=1
print("AC" if a==1 else "WA")

Solution (Python):
S = input()
if S[0] == 'A' \
    and S[2:len(S) - 1].count('C') == 1 \
    and ''.join([S[i] for i in range(len(S)) if i != 0 and not (2 <= i and i < len(S) - 1 and S[i] == 'C')]).islower():
    print('AC')
else:
    print('WA')

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

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

del s[number]
del s[0]

for j in s:
    c = j.lower()
    if c == j:
        continue
    else:
        print("WA")
        exit()
print("AC")

Solution (Python):

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

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

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

a = s.pop(0)
b = s.pop(0)
c = s.pop(-1)

if s.count('C') == 1:
    flag += 1

if flag ==2:
    s.append(b)
    s.append(c)
    
    for i in range(len(s)):
        if s[i].islower():
            count += 1
        
    if (count+1) == len(s):
        flag += 1

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

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

if not S[0]=="A":
  print("WA")
else:
  if not S.count("C") == 1:
    print("WA")
  elif S[-1]=="C" or S[1]=="C":
    print("WA")
  else:
    S.remove('A')
    S.remove('C')
    if str(S).islower():
      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):
import re

s = input()

if s[0] != "A":
    print("WA")
elif s[2:-1].count("C") != 1:
    print("WA")
elif re.search("[BD-Z]", s) is not None:
    print("WA")
else:
    print("AC")

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

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

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

Solution (Python):
s = input()


li = "abdefghijklmnopqrstuvwxyz"
li = li.upper()
li = list(li)

if s[0] == "A" and "C" in s[2:-1] and s.count("C") == 1:
    for i in li:
        if i not in s[1:]:
            pass
        else:
            print("WA")
            break
    else:
        print("AC")
else:
    print("WA")

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


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


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


s2 = S[1:].replace('C', '')
s2_lower = s2.lower()
if (s2 != s2_lower) or S.count('C') != 1:
	ans = 'WA'

print(ans)

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

if S[0] == 'A':
    S.pop(0)
    big = []
    for i in range(1, len(S)-1):
        if S[i] == 'C':
            big.append(i)
    if len(big) == 1:
        S.pop(big[0])
        for s in S:
            if s.isupper():
                flag = False
    else:
        flag = False
else:
    flag = False

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

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

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

l = len(S)
if S.count('C',2,l-1) != 1:
    print('WA')
    exit()
    
if len(re.findall('[A-Z]',S)) == 2:
    print('AC')
else:
    print('WA')

Solution (Python):
S = input()

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

print('WA')

Solution (Python):
S = input()

decAC = False
declow = False
if S[0] == "A" and S[2:-1].count("C") == 1:
    decAC = True

cnt = 0
for ss in S:
    if ss.islower():
        cnt += 1
if cnt == len(S)-2:
    declow = True
    
if decAC and declow:
    print("AC")
else:
    print("WA")

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

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

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

def out_wa():
  print('WA')

if s_list[0]!='A':
  out_wa()
else:
  count=0
  for i in range(2,len(s_list)-1):
    if s_list[i] == 'C':
      count+=1

  if count != 1:
    out_wa()
  else:
    s = ''.join(s_list)
    s=s.replace('A','')
    s=s.replace('C','')
    l_s=s.lower()
    if l_s !=s:
      out_wa()
    else:
      print('AC')

Solution (Python):

S=input()


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



if 'C' not in S[2:-1]:
  print('WA')
  exit()


s=list(S)
s.remove('A')
s.remove('C')

for x in s:
  if x not in 'abcdefghijklmnopqrstuvwxyz':
    print('WA')
    exit()


print('AC')

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):
from collections import Counter
s=input()
a=len(s)
counter = Counter(s[2:a-1])
if s[0]!="A":
  print("WA")
  
elif counter["C"]!=1:
  
    print("WA")
else:
  
  s[1:].replace("C","c",1)
  if s[1:].replace("C","c",1).islower()==False:
    print("WA")
  else:
    print("AC")

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

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

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

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

if s[2:len(s)-1].count("C") == 1:
    print("AC")
else:
    print("WA")

Solution (Python):
s = input()
alp = "abcdefghijklmnopqrstuvwxyz"
if (s[0]=='A')and (s[2:-1].count('C')==1):
    s = s.replace('A','').replace('C','')
    for c in s:
        if not(c in alp):
            print("WA")
            exit()
    print("AC")
else: print("WA")

Solution (Python):
S = raw_input()
flag1 = S[0] == 'A'

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

if not(flag1 and flag2): print 'WA'
else:
	flag3 = True
	for i in range(1, len(S)):
		if i != index:
			n = ord(S[i])
			if n < 97: flag3 = False
	if flag3: print 'AC'
	else: print 'WA'

Solution (Python):
S = input()
alp = "abcdefghijklmnopqrstuvwxyz"
alpC = "abcdefghijklmnopqrstuvwxyzC"

ans = "AC"
if S[0] != "A":
    ans = "WA"
countC = 0
for i in S[2:-1]:
    if i == "C":
        countC += 1
    if not i in alpC:
        ans = "WA"
if countC != 1:
    ans = "WA"
if not S[1] in alp:
    ans = "WA"
if not S[-1] in alp:
    ans = "WA"
print(ans)

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):
if __name__ == '__main__':
    S = str(input())

    tmp_S = S[2:len(S)-1]
    tmp_S_2 = S[1] + tmp_S.replace('C', '') + S[len(S)-1]

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

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

Solution (Python):
import re
S = list(input())
S2=''.join(S)
ans=0
cou=2
Ccou=0
A=S.count('A')
C=S.count('C')
jud = len(re.findall('[A-Z]', S2))
rep=len(S)-2
if S[0]=='A':
    ans=+1
rep=len(S)-2
for i in range(1,rep):
    if S[cou]=='C':
        Ccou=Ccou+1
    cou=cou+1
if Ccou == 1:
    ans=ans+1
if ans ==2 and A==1 and C==1 and jud==2:
    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):
import re
S = input()
if re.match("^A[a-z][a-z]*C[a-z]*[a-z]$", S):
  print("AC")
else:
  print("WA")

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

Solution (Python):

import sys


def solve(S: str):
    bAC = True

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

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

    if not S.replace("A","").replace("C","").islower():
        bAC = False

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


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    solve(S)

if __name__ == '__main__':
    main()

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

Solution (Python):
s  = input()
f = True
if s[0] != "A":
    f = False
c = 0
for i in range(2, len(s) - 1):
    if s[i] == "C":
        c += 1
if c != 1:
    f=False
ss = s[1:].replace("C", "")
for i in range(len(ss)):
    if ss[i] < "a" or ss[i] > "z":
        f = False
if f:
    print("AC")
else:
    print("WA")

Solution (Python):
from string import ascii_lowercase
S = input()
if not S[0] is 'A' or not 'C' in S[2:-1]:
    print('WA'),exit()
for i in range(1,len(S)):
    if i == S.index('C'):
        continue
    if not S[i] in ascii_lowercase:
        print('WA'),exit()
print('AC')

Solution (Python):
from string import ascii_lowercase
S = input()
try:
    if not S[0] is 'A' or not 'C' in S[2:-1]:
        raise RuntimeError
    for i in range(1,len(S)):
        if i == S.index('C'):
            continue
        if not S[i] in ascii_lowercase:
            raise RuntimeError
    print('AC')
except:
    print('WA')

Solution (Python):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    s = input()
    ok = False
    if s[0] == 'A':
        cnt_C = 0
        for i in s[2:-1]:
            if i=='C':
                cnt_C += 1
        if cnt_C == 1:
            cnt_up = 0
            for i in s:
                if i != i.lower():
                    cnt_up+= 1
            
            if cnt_up == 2:
                ok = True
    
    if ok:
        print('AC')
    else:
        print('WA')


solve()

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


flag = True

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

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

a = 0
c = 0
for i in S:
    if i == 'A':
        a += 1
    if i == 'C':
        c += 1
    if a >= 2 or c >= 2:
        flag = False
    if i != 'A' and i != 'C':
        if i != i.lower():
            flag = False

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

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

print(ans)

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

Solution (Python):
s = input()

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

Solution (Python):
S = input()


def judge(s):
    if s[0] != 'A':
        return 'WA'

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

    t = s.find('C')
    s[1:t]

    return 'AC' if s[1:t].islower() and s[t+1:].islower() else 'WA'


print(judge(S))

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

Solution (Python):
S = input()
OK = True
if S[0] != "A":
    OK = False
if S[2:-1].count("C") != 1:
    OK = False
large = 0
for s in S:
    if ord("A") <= ord(s) <= ord("Z"):
        large += 1
if large != 2:
    OK = False
if OK:
    print("AC")
else:
    print("WA")

Solution (Python):
s = input()
flg = 0
if s[0]!="A":
    print("WA")
elif s[2:-1].count("C") !=1:
    print("WA")
else:
    index = s.find("C")
    all_ind = [i for i in range(1,len(s))]
    all_ind.remove(index)
    for i in all_ind:
        if s[i].isupper():
            flg = 1
            print("WA")
            break
    if flg==0:
        print("AC")

Solution (Python):
s = input()

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

Solution (Python):
def judge(s):
    n=len(s)
    if s[0]!="A":
        return False
    if s[2:n-1].count("C")!=1:
        return False
    ss=s[1:].replace("C","c")
    if ss.islower():
        return True
    return False


s=input()
if judge(s):
    print("AC")
else:
    print("WA")

Solution (Python):
from sys import stdin
import re

S = stdin.readline().rstrip()

pattern1 = r"^A([a-z])C([a-z]{1,7})$"
pattern2 = r'^A([a-z]){2}C([a-z]{1,6})$'
pattern3 = r'^A([a-z]){3}C([a-z]{1,5})$'
pattern4 = r'^A([a-z]){4}C([a-z]{1,4})$'
pattern5 = r'^A([a-z]){5}C([a-z]{1,3})$'
pattern6 = r'^A([a-z]){6}C([a-z]{1,2})$'
pattern7 = r'^A([a-z]){7}C([a-z]{1})$'

if (re.match(pattern1, S)) or (re.match(pattern2, S)) or (re.match(pattern3, S)) or (re.match(pattern4, S)) \
        or (re.match(pattern5, S)) or (re.match(pattern6, S)) or (re.match(pattern7, S)):
    print('AC')
else:
    print('WA')

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

Solution (Python):
import sys
import re

s = input()
check = len(s)
if ('A' in s[0]) and ('C' in s[2:len(s)-1]):
    if s.count('C') == 1:
        next_s = s.replace('C', '', 1)
        if next_s[1:len(next_s)].islower():
            print('AC')
            sys.exit()
print('WA')

Solution (Python):
S = input()
lead = S[0]
sub = S[2:-1]
C = sub.count('C')
if lead == 'A' and C == 1:
  for x in range(1,len(S)):
    if S[x].islower() or S[x] == 'C':
      pass
    else:
      print('WA')
      exit()
  print('AC')
else:
  print('WA')

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

if (x[0:1]=='A') :
    pass
else:
    print('WA')
    sys.exit()

if 'C' in x[2:len(x)-1]:
    pass
else:
    print('WA')
    sys.exit()

z=x[2:len(x)-1]
    
if z.count('C')==1:
    pass
else:
    print('WA')
    sys.exit()

y=x.replace('C','c')
y=y.replace('A','a')


if str.islower(y):
    print('AC')
else:
    print('WA')

Solution (Python):
input_a = input()
if input_a[0] != 'A':
    print("WA")
elif input_a.count('C')==0:
    print("WA")
elif input_a.count('C')>1:
    print("WA")
elif input_a.index('C') <=1:
    print("WA")
elif input_a.index('C') ==len(input_a)-1:
    print('WA')
elif input_a.count('C') ==1:
    if input_a.replace('A','a').replace('C','c').islower():
        print('AC')
    else:
        print('WA')

Solution (Python):
input_a = input()
if input_a[0] != 'A':
    print("WA")
elif input_a.count('C')==0:
    print("WA")
elif input_a.count('C')>1:
    print("WA")
elif input_a.index('C') <=1:
    print("WA")
elif input_a.index('C') ==len(input_a)-1:
    print('WA')
elif input_a.count('C') ==1:
    if input_a.replace('A','a').replace('C','c').islower():
        print('AC')
    else:
        print('WA')

Solution (Python):
s = input()

noAC = s.replace('A', '').replace('C', '', 1)
content = s[2:len(s)-1]

if s[0] != 'A' or (not('C' in content)) or (not noAC.islower()):
  print('WA')
else:
  print('AC')

Solution (Python):
s = list(input())
c = 0
if s[0] != "A":
    print("WA")
else:
    for i in s[2:-1]:
        if i == "C":
            c += 1
            b = i
    if c == 1:
        s.remove(s[0])
        s.remove(b)
        if "".join(s).islower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")

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

else:print("WA")

Solution (Python):
s=list(input())
if s[0]!='A':
    print('WA')
else:
    if s.count('C')!=1:
        print('WA')
    else:
        if s.index('C')<2 or s.index('C')>len(s)-2:
            print('WA')
        else:
            s.remove('A')
            s.remove('C')
            count=0
            for i in range(len(s)):
                if str.islower(s[i]):
                    count+=1
            if count==len(s):
                print('AC')
            else:
                print('WA')

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

Solution (Python):
s = input()
if s[0] != 'A':
    print('WA')
    exit()
a = ord(s[1])
if not ord('a') <= a <= ord('z'):
    print('WA')
    exit()
a = ord(s[-1])
if not ord('a') <= a <= ord('z'):
    print('WA')
    exit()
c,d = 0,0
for i in s[2:]:
    if i == 'C':
        c += 1
    elif ord('a') <= ord(i) <= ord('z'):
        d += 1
    else:
        print('WA')
        exit()
if c != 1:
    print('WA')
    exit()
if c + d != len(s) - 2:
    print('WA')
    exit()
print('AC')

Solution (Python):
import re

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

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

if S[0] != 'A':
    ans = False
elif S[2:-1].count('C') != 1:
    ans = False
elif not (S[1] + S[2:-1].replace('C', '') + S[-1]).islower():
    ans = False
print('AC' if ans else 'WA')

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

Solution (Python):
s = input()

ans = True

if s[0] != 'A':
  ans = False
  
cnt = 0
for i in range(2, len(s) - 1):
  if s[i] == 'C':
    cnt += 1
    
if cnt != 1:
  ans = False
  
cnt = 0
for c in s:
  if c.isupper():
    cnt += 1
    
if cnt != 2:
  ans = False
  
if ans:
  print("AC")
else:
  print("WA")

Solution (Python):
import string
S = input()
ans = [False,False,False]
if S[0] == 'A':
    ans[0] = True
if 'C' in S[2:-1]:
    ans[1] = True
if ans[0] == True and ans[1] == True and list(S).count('C') == 1:
    x = list(S)
    del x[0]
    x.remove('C')
    for i in range(len(x)):
        if x[i] not in list(string.ascii_lowercase):
            break
        if i == len(x) -1:
            ans[2] = True
if ans[0] and ans[1] and ans[2]:
    print('AC')
else:
    print('WA')

Solution (Python):

import sys


def solve(S: str):
    ret = 'AC'
    if S[0] != 'A':
        ret = 'WA'
    else:
        count = 0
        for i, c in enumerate(S[1:]):
            if not c.islower():
                if count < 1 and c == 'C' and i >= 1 and i <= len(S) - 3:
                    count += 1
                else:
                    ret = 'WA'
                    break
        if count < 1:
            ret = 'WA'
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    solve(S)

if __name__ == '__main__':
    main()

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

Solution (Python):


from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    if y > x // 2:
        y = x - y

    ret = 1

    for i in range(0, y):
        j = x - i
        i = i + 1

        ret = ret * j
        ret = ret // i

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance





def main():
    s = input()

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

    count = 0
    for c in s[2:-1]:
        if c == 'C':
            count += 1
    if count != 1:
        print('WA')
        return

    if s[1].isupper():
        print('WA')
        return

    if s[-1].isupper():
        print('WA')
        return

    for c in s[2:-1]:
        if c != 'C' and c.isupper():
            print('WA')
            return

    print('AC')


if __name__ == '__main__':
    main()

Solution (Python):
s=input()
al=[chr(ord('a')+i) for i in range(26)]
f=False
if s[0]=='A':
    s_ = s[2:-1]
    Ccount=0
    for a in s_:
        if a in al:
            continue
        elif a=='C':
            if Ccount==1:
                Ccount+=1
                break
            else:
                Ccount+=1
        else:
            break
    if Ccount==1:
        f=True
    if s[-1] not in al:
        f=False
    if s[1] not in al:
        f=False
print('AC' if f else 'WA')

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

Solution (Python):
def count_apper(str) :
    n = 0
    for c in str :
        if c.isupper() :
            n = n+1
    return n

str = input()
if (str[0] == "A") and (str.count("C") == 1) and (1 < str.find("C") < len(str)-1) and (count_apper(str) == 2) :
                print("AC")
                exit()
print("WA")

Solution (Python):
s = input()
judg = [False]*3
if s[0] == "A":
  judg[0] = True
  if s[2:-1].count("C") == 1:
    judg[1] = True
    if (s[1] + s[-1]) == (s[1] + s[-1]).lower():
      judg[2] = True
print("AC" if all(judg) else "WA")

Solution (Python):
S = input()

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

Solution (Python):
s=list(str(input()))
n=len(s)
t=True
c=0
for i in range(n):
    if i == 0:
        if s[i]=="A":
            t=t and True
        else:
            t=False
    elif i == 1:
        if s[i]>="a" and s[i]<="z":
            t=t and True
        else:
            t = False
    else:
        if i!=n-1 and s[i] == "C":
            c+=1
        elif s[i]>="a" and s[i]<="z":
            t=t and True
        else:
            t = False
if c==1:
    t=t and True
else:
    t=False
if t:
    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() and (s[2:-1] == 'C' or s[2:-1].replace('C','').islower()):
    print('AC')
else:
    print('WA')

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

if s[0]!='A':
    print('WA')
else:
    if s.count('C')!=1:
        print('WA')
    else:
        if s.index('C')<2 or s.index('C')>len(s)-2:
            print('WA')
        else:
            s.remove('A')
            s.remove('C')
            
            count=0
            for i in range(len(s)):
                if str.islower(s[i]):
                    count+=1
            if count==len(s):
                print('AC')
            else:
                print('WA')

Solution (Python):
def main():
    s = list(input())
    count = 0

    if s[0] == 'A':
        for i in range(2, len(s)-1):
            if s[i] == 'C':
                count += 1
        if (count != 1):
            return 'WA'
        count = 0
        for i in range(len(s)):
            if s[i].isupper():
                count += 1
        if count > 2:
            return 'WA'
    else:
        return 'WA'

    return 'AC'
    


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

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

Solution (Python):
S = input()

if S[0] != "A" or S[2:-1].count("C") != 1:
    print("WA")
    exit()
else:
    S = S.replace("C","c", 1)

if S[1:].islower() == True:
    print("AC")
else:
    print("WA")

Solution (Python):
import sys

S = input()

if S[0] != 'A':
    print('WA')
    sys.exit()
if S[2:-1].count('C') != 1:
    print('WA')
    sys.exit()
position_C = S.find('C',2,-1)
AC_removed_S = S[1:position_C] + S[position_C+1:]

print('AC' if AC_removed_S.islower() else 'WA')

Solution (Python):
import re

S = input()

if S[0] == 'A' \
        and S[2:-1].count('C') == 1 \
        and re.match('^A[a-z]+C[a-z]+$', S):
    print('AC')
else:
    print('WA')

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

Solution (Python):
S=list(input())
flag1=0
if S[0]!="A":
  flag1=1

S.pop(0)
flag2=0
for i in range(1,len(S)-1):
  if S[i]=="C":
    flag2=1
    S.pop(i)
    break
if flag2==0:
  flag1=1

for i in range(len(S)):
  if S[i] in list("ABCDEFGHIJKLMNOPQRSTUVWXYZ"):
    flag1=1

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

Solution (Python):
S = input()

ans = "WA"
if S[0] == "A":
    ans = "AC"
    S = S.replace("A", "a", 1)

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

if not S.islower():
    ans = "WA"

print(ans)