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":
    print("WA")
    exit()
if s[1].isupper():
    print("WA")
    exit()
if s[-1].isupper() or s[-1] == "C":
    print("WA")
    exit()
flag = False
for c in s[2:]:
    if c == "C":
        if flag:
            print("WA")
            exit()
        else:
            flag = True
    else:
        if c.isupper():
            print("WA")
            exit()
if flag:
    print("AC")
else:
    print("WA")

Solution (Python):
S = input()

if S[0] == 'A':
    S = S[1:]
    index = 0
    i_count = 1
    count = 0
    for i in S[1:-1]:
        if i == 'C':
            count += 1
            index = i_count
        i_count += 1
    if count == 1:
        S = S[0:index] + S[index+1:]
        if S.islower():
            print('AC')
            exit()

print('WA')

Solution (Python):
import re


def main() -> None:
    print("AC" if re.search("^A[a-z]+C([a-z]*)[a-z]$", input()) else "WA")


if __name__ == '__main__':
    main()

Solution (Python):
import re


def main() -> None:
    S = input()
    if re.search("^A[a-z]+C([a-z]*)[a-z]$", S):
        print("AC")
    else:
        print("WA")


if __name__ == '__main__':
    main()

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

for i in range(2, len(s) - 1):
    if s[i] == 'C':
        s.pop(i)
        break
else:
    print('WA')
    sys.exit(0)
 
if ''.join(s[1:]) == ''.join(s[1:]).lower():
    print('AC')
else:
    print('WA')

Solution (Python):
S = input()
if S[0] != "A":
    print("WA")
    exit()
if S[2:-1].count("C") != 1:
    print("WA")
    exit()
c = S[2:-1].index("C") + 2
for i, s in enumerate(S):
    if i == 0 or i == c:
        continue
    if s.isupper():
        print("WA")
        exit()
print("AC")

Solution (Python):
s = input()

torf = True


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


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

cindex = s[2:-1].find("C") + 2

slist = list(s)

slist.pop(cindex)
slist.pop(0)

s1 = "".join(slist)
if s1.islower() != True:
    torf = False

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

Solution (Python):
import sys

def main():
  input = sys.stdin.readline
  S = str(input())
  ans = 'WA'
  if S[0] == 'A':
    if 'C' in S[2:-2]:
      S = S.replace('A', '', 1)
      S = S.replace('C', '', 1)
      if S.islower():
        ans = 'AC'
        
  print(ans)


if __name__ == '__main__':
  main()

Solution (Python):
s = input()

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

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

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

if cnt != 1:
    print('WA')
    exit()
index = 0
for i in range(2, len(s) - 1):
    if s[i] == 'C':
        index = i
        break


test = s[2:index] + s[index + 1:len(s)]


if test.islower():
    print('AC')
else:
    print('WA')
exit()

if index != 2 and index + 1 != len(s) - 1:
    if s[2:index].islower() and s[index + 1:len(s) - 1].islower():
        print('AC')
    else:
        print('WA')

elif index == 2:
    if s[index + 1:len(s) - 1].islower():
        print('AC')
    else:
        print('WA')
else:
    if s[2:index].islower():
        print('AC')
    else:
        print('WA')

Solution (Python):
str_s = input()

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

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

idx_c = str_s.find("C")

w_str = str_s[1:idx_c] + str_s[idx_c +1:]
if w_str.islower():
    print("AC")
else:
    print("WA")

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

Solution (Python):
S = input()
T = S.replace("A","").replace("C","")

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

Solution (Python):
s=input()
count=0
if s[0]=='A':
    for i in range(2,len(s)-1):
        if s[i]=='C':
            count+=1
            index=i

    
    if count==1:
        x=s[1:index]+s[index+1:]
        if x.islower():
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
            
else:
    print('WA')

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

Solution (Python):
S = input()

flg = True

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

cnt = 0

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

if cnt != 1:
    flg = False

cnt = 0

for i in range(len(S)):
    if 'A' <= S[i] <= 'Z':
        cnt += 1

if cnt != 2:
    flg = False

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

Solution (Python):
s = str(input())
l = 'qwertyuiopasdfghjklzxcvbnmAC'
if s[0]=="A":
    s_ = s[2:-1]
    c=0
    for w in s_:
        if w=='C':
            c+=1
    if c==1:
        for i in range(len(s)):
            if not s[i] in l:
                break
            if i==len(s)-1:
                print('AC')
                import sys
                sys.exit()
print('WA')

Solution (Python):

s = str(input())
ans = 'WA'
c_list = [c  for c in s]
if s[0] == 'A':
    if s[2:-1].count('C') == 1:
        c_list.remove('A')
        c_list.remove('C')
        if all((ord('a') <= ord(x) <= ord('z') for x in c_list)):   
            ans = 'AC'
print(ans)

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():
        print('AC')
        exit()
print('WA')

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

Solution (Python):
S=input()
hoge=S[2:-1]
result=False
if S[0]=="A":
    if "C" in hoge:
        a=S[1:hoge.find("C")+2]+S[hoge.find("C")+3:]
        if a==a.lower():
            result=True
if result==True:
    print("AC")
else:
    print("WA")

Solution (Python):
s = input()
f1 = s[0] == "A"
f2 = s[2:-1].count("C") == 1
index = s[2:-1].find("C") + 2
f3 = (s[1:index]+s[index+1:]).lower() == (s[1:index]+s[index+1:])
print("AC" if f1 and f2 and f3 else "WA")

Solution (Python):
s = input()

ans = "WA"
if s[0] == "A" and s[2:-1].count("C") == 1 and s[1] != "C" and s[-1] != "C":
    s2 = s.replace("A","a").replace("C","c")
    if s2 == s.lower():
        ans = "AC"

print(ans)

Solution (Python):
from collections import Counter

class Solver(object):
    def __init__(self):
        self.s = input()

    def solve(self):
        if self.s[0].upper() != "A":
            print("WA")
            return

        counter = Counter(self.s)
        subset_counter = Counter(self.s[2:-1])

        if counter['A'] != 1:
            print("WA")
            return

        if subset_counter['C'] != 1:
            print("WA")
            return
        
        counter.pop('A')
        counter.pop('C')

        for char in counter:
            if char != char.lower():
                print("WA")
                return

        print("AC")

if __name__ == "__main__":
    s = Solver()
    s.solve()

Solution (Python):
s = input()

ans = "WA"
if s[0] == 'A' and s[2:-1].count('C') == 1 and s[1] != 'C' and s[-1] != 'C':
    s2 = s.replace('A', 'a').replace('C', 'c')
    if s2 == s.lower():
        ans = "AC"
print(ans)

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

Solution (Python):
s=input()

x=[];
Ccount=0

while(1):

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

    s=s.strip("A")

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

    if Ccount!=1:
        print('WA')
        break

    s=s.replace("C","")

    if s.islower()==0:
        print('WA')
        break

    print('AC')
    break

Solution (Python):
s = input()

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

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

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

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

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

Solution (Python):
s = list(str(input()))
count = 0
uppercount = 0
for i in range(len(s)):
    if s[i] == "C":
            count += 1
for c in s:
    if c.isupper():
        uppercount += 1

if s[0] == "A" and "C" in s[2:-1] and count == 1 and uppercount == 2:
    print("AC")
else:
    print("WA")

Solution (Python):
alph = 'abcdefghijklmnopqrstuvwxyz'

s = input()
if s[0] == 'A' and s[1] in alph and s[-1] in alph:
    c = 0
    cnt = 0
    for i in range(2,len(s)-1):
        if s[i] == 'C':
            c += 1
        else:
            if s[i] in alph:
                cnt += 1
                
    if c == 1 and cnt == len(s)-4:
        print('AC')
        exit()

print('WA')

Solution (Python):
s = input()
s_prime = ""
if s[0] != "A":
    
    print("WA")
else:
    s_prime = s[1:]
    if s[2:-1].count("C") != 1:
        
        print("WA")
    else:
        s_prime = s_prime.replace("C","")
        
        if s_prime.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 s[1] == 'C' or s[-1] == 'C':
    ans = 'WA'
reps = s.replace('A', 'a').replace('C', 'c')    
if reps != s.lower():
    ans = 'WA'

print(ans)

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

if S[0] == "A":
    if S[2:-1].count("C") == 1 and S[1] != "C" and S[-1] != "C":
        S_A = S.replace("A", "", 1)
        S_AC = S_A.replace("C", "")
        if S_AC.islower() == True:
            print("AC")
            sys.exit()


print("WA")

Solution (Python):
from statistics import mean, median,variance,stdev
import sys
import math
import fractions

def j(q):
    if q==1: print("AC")
    else:print("WA")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())






a = input()                                  





if a[0] != 'A':j(0)
b = a[2:len(a)-1]
if b.count('C') != 1:j(0)
if a[len(a)-1] == 'C':j(0)
b = a[1:]
for i in range(1,len(a)):
    p = a[i].lower()
    if not (p == a[i] or a[i]=='C'):
        j(0)
j(1)

Solution (Python):
S = input()

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

Solution (Python):


















import collections
def inpl(): return list(map(int, input().split()))


S = input()

flag = True
if S[0] != "A":
  flag = False
if S[2:-1].count("C") != 1:
  flag = False
if sum([s.islower() for s in S]) != len(S)-2:
  flag = False

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

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

Solution (Python):
alpha = [str(chr(i)) for i in range(97,97+26)]

def main():
    S = list(raw_input())
    if S[0] != 'A':
        return 'WA'
    S.remove('A')
    flag = True
    for i in S[1:-1]:
        if i == 'C':
            flag = False
            S.remove('C')
            break;
    if flag:
        return 'WA'
    for i in S:
        if i not in alpha:
            return 'WA'
    return 'AC'

print main()

Solution (Python):
S = input()

ans = 'AC'

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

S = list(S)
if S.count('C')>0:
    S.remove('C')

if (''.join(S[1:])).islower() == False:
    ans = 'WA'

print(ans)

Solution (Python):
s = input()
l = s[2:len(s)-1]
for i in s:
    if i not in "abcdefghijklmnopqrstuvwxyzAC":
        print("WA")
        exit()
else:
    if s[0]=="A" and l.count("C")==1:
        print("AC")
    else:
        print("WA")

Solution (Python):
S=input()
ok=False
if S[0]=='A'and 'C'in S[2:-1]:
    a=S.index("C")
    if S[1:a].islower()and S[a+1::].islower():
        ok=True
print('AC'if ok else 'WA')

Solution (Python):
s = list(map(str,input()))
ans = 0
if s[0] == "A":
    ans += 1
S = (s[2:-1])
c = 0
cp = 0
for i in range(len(S)):
    if S[i] == "C":
        c += 1
        cp = i
if c == 1:
    ans += 1
isl = 0
for i in range(len(s)):
    if i == 0 or i == cp+2:
        pass
    else :
        if s[i].islower():
            isl += 1
if isl == len(s)-2:
    ans += 1
if ans == 3:
    print("AC")
else :
    print("WA")

Solution (Python):
S=input()
if(S[0]=='A'):
  S_1=S[1:]
else:
  print('WA')
  exit()
if(S[2:(len(S)-1)].count('C')==1):
  S_2=S_1[0:len(S_1)-1].replace('C','')
else:
  print('WA')
  exit()
S_3=S_2+S[-1]



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

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

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

Solution (Python):
s=input()
ss=[]
if(s[0]=='A'):
    if('C' in s[2:-1]):
        a=s.find('A')
        b=s.find('C')
        if(s[a+1:b].islower() and s[b+1:].islower()):
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Solution (Python):
s=list(input())
ans='AC'
if s[0]!='A':
    ans='WA'
if s[1]=='C':
    ans='WA'
t=s[2:-1]
if t.count('C')!=1:
    ans='WA'
u=list(set(s)-{'A','C'})
for i in range(len(u)):
    if u[i].isupper():
        ans='WA'
print(ans)

Solution (Python):
s = list(input())
if s[2:-1] .count('C')==1 and s[0]=='A':
  tmp = s.index('C')
  s.pop(tmp)
  s.pop(0)
  a = str(''.join(s))
  if a.islower()==True:
    print('AC')
    exit()  
print('WA')

Solution (Python):

import sys

S = input()
if S[0] != 'A':
    print('WA')
    sys.exit(0)
for l in S:
    if l in list('BDEFGHIJKLMNOPQRSTUVWXYZ'):
        print('WA')
        sys.exit(0)

re = len(list(filter( lambda x: x == 'C', S[2:-1])))
if re == 1:
    print('AC')
else:
    print('WA')

Solution (Python):
def main():
    S = input()
    if S[0] != 'A':
        print('WA')
        exit()
    if S[2:-1].count('C') != 1:
        print('WA')
        exit()
    s = list(S)
    s[0] = 'a'
    ci = 2 + S[2:-1].index('C')
    s[ci] = 'c'
    if ''.join(s) != S.lower():
        print('WA')
        exit()
    print('AC')


main()

Solution (Python):


def main():
    s = input()
    flag = True
    if s[0] != "A":
        flag = False
    if "C" not in s[2:-1]:
        flag = False
    if count_upper(s) != 2:
        flag = False
    print("AC" if flag else "WA")

def count_upper(s):
    upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    assert len(set(upper)) == 26
    res = 0
    for c in s:
        if c in upper:
            res += 1
    return res

main()

Solution (Python):
""" AtCoder """

S = input()
count = 0

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

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

Solution (Python):
s = input()

flag = 0


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

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


count =0
s_small = s.lower()
for i in range(len(s)):
  if s_small[i] !=s[i]:
    count += 1

if count !=2:
  flag =1
  
print("AC" if flag ==0 else "WA")

Solution (Python):


def main():
    S = input()

    f = False

    if S[0] == 'A':
        if S.count('C') == 1:
            i = S.index('C')
            if 2 <= i and i < len(S) - 1:
                if S[1:i].islower() and S[i+1:].islower():
                    f = True


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


if __name__ == '__main__':
    main()

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

Solution (Python):
S = list(input())
cnt = 0
if S[0] == "A":
  cnt += 1
  del S[0]
if  "C" in S[1:-1]:
  cnt += 1
  S.remove("C")
if  "C" in S[1:-1]:
  cnt -= 1
  S.remove("C")
if ("".join(S)).islower():
  cnt += 1
if cnt == 3:
  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:
    flag = True
    s = s.replace("A", "").replace("C", "")
    if s.islower() != True:
        print("WA")
    else:
        print("AC")

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

    if s[0] == "A":
        s1 = s[2:-1]
        if s1.count("C") == 1:
            s2 = re.sub(r'[a-z]', '', s)
            if len(s2) == 2:
                print("AC")
                return
    print("WA")


if __name__ == '__main__':
    main()

Solution (Python):
S = input()

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

Solution (Python):
import re 
s = input()
ans = "WA"
if s[0]=="A":
    if s[2:-1].count("C") == 1:
        if len(re.findall("[A-Z]",s)) == 2:
            ans = "AC"
print(ans)

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

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

Solution (Python):
import re
S = input()
if (S[0] == 'A'):
	if (S[2:-1].count('C') == 1):
		if (len(re.findall('[A-Z]', S)) == 2):
			print('AC')
			exit()
print('WA')

Solution (Python):
import re
S = input()
if (S[0] == 'A'):
	if (S[2:-1].count('C') == 1):
		if (len(re.findall('[A-Z]', S)) == 2):
			print('AC')
			exit()
print('WA')

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

Solution (Python):

def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()
def LIR(n): return [LI() for i in range(n)]


s = S()
if s[0] != "A":
    print("WA")
else:
    count = []
    for i in range(2,len(s)-1):
        if s[i] == "C": count.append(i)
    if len(count) != 1:
        print("WA")
    else:
        for i in range(1,len(s)):
            if i not in count:
                if s[i] == s[i].upper():
                    print("WA")
                    quit()
        print("AC")

Solution (Python):
a=input()
d=["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"]
c=0
t=len(a)
if a[0]=="A":
    p=a[2:-1]
    if "C" in p:
        k=a[1:]
        t-=1
        q=0
        for i in range(t):
            if k[i]in d:
                q+=1
        if t-1==q:
            c=1
print("WA"if c!=1else"AC")

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

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

Solution (Python):
s = input()
ans = 'WA'

if s[0] == 'A':
    if s[2:-1].count('C') == 1:
        flag = 0
        for i in range(1,len(s)):
            if s[i].isupper():
                flag += 1
        if flag == 1:
            ans = 'AC'

print(ans)

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

Solution (Python):
S = input()

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

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

if S[0] == 'A':
	S[0] = 'a'
	cnt = 0
	flag = True
	for i, s in enumerate(S[2:-1]):
		if s == 'C':
			cnt += 1
			if flag:
				S[2+i] = 'c'
				flag = False
	if cnt == 1 and ''.join(S).islower():
		print('AC')
		exit(0)

print('WA')

Solution (Python):
import re

s = input()
if s[0] != "A":
    print("WA")
elif s[2:-1].count("C") != 1:
    print("WA")
else:
    i = 2 + s[2:-1].index("C")
    print("AC" if re.match("^[a-z]*$", s[1] + s[2:i] + s[i+1:]) else "WA")

Solution (Python):
def piyo():
    s = list(str(input()))
    c = 0
    a = 0
    if s[0]!="A":
        return "WA"
    if s[1]=="C" or s[len(s)-1]=="C":
        return "WA"
    for hage in s:
        if hage!="A" and hage!="C":
            if hage.isupper():
                return "WA"
        if hage=="C":
            c+=1
        if hage=="A":
            a+=1
    if c>1 or c==0:
        return "WA"
    if a>1:
        return "WA"
    return "AC"
        
if __name__ == '__main__':
    hoge=piyo()
    print(hoge)

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

Solution (Python):
S = input()

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

Solution (Python):
s = input()
f = False
for i,c in enumerate(s):
    if i == 0:
        if c != 'A':
            print('WA')
            exit()
    elif i == 1 or i == len(s) - 1:
        if ord('A') <= ord(c) <= ord('Z'):
            print('WA')
            exit()
    elif c == 'C':
        if f:
            print('WA')
            exit()
        f = True
    elif ord('A') <= ord(c) <= ord('Z'):
        print('WA')
        exit()
if f:
    print('AC')
else:
    print('WA')

Solution (Python):
S = input()



res = True
if S[0]!='A':
    res = False
if S[2:-1].count('C')!=1:
    res = False
cnt = 0
for c in S:
    if ord('a')<= ord(c) and ord(c) <= ord('z'):
        cnt+=1
if cnt!=len(S)-2:
    res=False


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

Solution (Python):
s = input()

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

if(ans==0):
    print('AC')

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

Solution (Python):

S = input()

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

Solution (Python):

S = input()

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

Solution (Python):
S = str(input())
s = S[2:len(S)-1]
k = s.count("C")
def main(S):
    C_index = S.find("C")
    S = S[1:C_index]+S[C_index+1:]
    if S.lower() == S:
        return 1
    else:
        return 0

if S[0] != "A":
    print("WA")
elif k > 1 or k == 0:
    print("WA")
elif main(S) == 0:
    print("WA")
else:
    print("AC")

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

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

Solution (Python):
s = str(input())
flag = 0
flag2 = 0
if s[0] == 'A':
    for i in range(2,len(s)-1):
        if s[i] == 'C':
            flag += 1
    for i in range(1,len(s)):
        if s[i] == s[i].upper():
            flag2 += 1

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

Solution (Python):
S = input()

ans = "WA"
if S[0] == "A":
    if S[2:-1].count("C") == 1:
        ans = "AC"
        for i in range(len(S)):
            if i==0:
                continue
            if S[i]=="C":
                continue
            if S[i].isupper():
                ans = "WA"

print(ans)

Solution (Python):
S=input()

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

kaburi=False
for i in range(len(S)):
    
    if S[i].isupper() and i>0:
        if S[i]=='C' and i>=2 and i<=(len(S)-2) and not kaburi:
            kaburi=True
            like_Center_C_flag=True
        else:
            print ( 'WA' )
            exit ( 0 )
if kaburi:
    print ( 'AC' )
else:
    print('WA')

Solution (Python):
S = input()
flag = True
if S[0] != 'A':
    flag = False
if S[2:len(S)-1].count('C') != 1:
    flag = False
S = S[1:].replace('C', 'c')
if S.islower() and flag is True:
    print('AC')
else:
    print('WA')

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

Solution (Python):



def main():
    """Function."""
    s = str(input())

    flag1, flag2, flag3 = 0, 0, 0
    if s[0] == "A":
        flag1 = 1

    c_site = 0
    if s[2:-1].count("C") == 1:
        flag2 = 1
        c_site = list(s[2:-1]).index("C") + 2

    if flag2 == 1:
        check = s[1:c_site] + s[c_site+1:]
        if check.islower():
            flag3 = 1

    if (flag1, flag2, flag3) == (1, 1, 1):
        print("AC")
    else:
        print("WA")


if __name__ == "__main__":
    main()

Solution (Python):
import re
A = input()
if A[0] == "A" and A[2:-1].count("C") ==1 and len(re.findall("[A-Z]",A))==2:
    print("AC")
else:
    print("WA")

Solution (Python):

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

Solution (Python):
S = input()


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

elif "C" in S:
    a = S.index("C")

    if 2 <= a <= len(S)-2:
        S = S.replace("A", "", 1).replace("C", "", 1)
        
        if S.islower():
            print("AC")
        
        else:
            print("WA")

    else:
        print("WA")

else:
    print("WA")

Solution (Python):
from collections import Counter


def ac(s):
    if s[0] != 'A':
        return False

    cs = Counter(s[2:-1])
    if cs['C'] != 1:
        return False

    cs.pop('C')
    return s[1].islower() and s[-1].islower() and all(c.islower() for c in cs.keys())


def main():
    s = input()
    if ac(s):
        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 = S.replace("A", "").replace("C", "")
    if all(i.islower() for i in S):
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
import re

S = input()

res = True

if S[0] != 'A':
  res = False
  
if S[2:-1].count('C') != 1:
  res = False
  
if len(re.findall('[a-z]', S)) != len(S) - 2:
  res = False
       
if res:
  print('AC')
else:
  print('WA')

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

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

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

judge = "AC"
if S[0] != "A":
	judge = "WA"
else:
	if s.count("C") != 1:
		judge = "WA"
	else:
		S = S.replace("A", "")
		S = S.replace("C", "")
		ch = "Yes"
		for i in S:
			if ord(i) <= 96:
				ch = "No"
		if ch == "No":
			judge = "WA"

print(judge)

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

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

Solution (Python):
s = input()

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

Solution (Python):
S = input()
Sl = [i for i in S]
Slen = len(Sl)
Cv = S.find("C")
C = Sl.pop(Cv)
A = Sl.pop(0)
lo = "".join(Sl)

if A == "A" \
and C == "C" \
and lo.islower() == True \
and 2 <= Cv < (Slen-1):
    print("AC")
else:
    print("WA")