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


def lower_checker(ss):

    for k in ss:
        if k != 'A' and k != 'C' and k.islower() is False:
            return False
    return True

def C_counter(ss):
    cnt = 0
    for k in ss:
        if k == 'C':
            cnt += 1
    if cnt == 1:
        return True
    else:
        return False

flag = True
if s[0] != 'A':
    flag = False
if flag is False or C_counter(s[2:-1]) is False:
    flag = False
if flag is False or lower_checker(s) is False:
    flag = False

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

Solution (Python):



def check(str):
	cnt = 0
	for s in str:
		if s.islower():
			cnt += 1
	return cnt == len(str) - 1 and str.find('C') != -1

S = input()

if S[0] == 'A' and S[1] != 'C' and S[len(S) - 1] != 'C' and check(S[2:len(S) - 1]) and S[1].islower() and S[len(S) - 1].islower():
	print('AC')
else:
	print('WA')

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

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

Solution (Python):
import re
import sys
S = input()
flg = 0
upperReg = re.compile(r'^[A-Z]+$')

def isupper(s):
    return upperReg.match(s) is not None

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

for j in range(2,len(S)):
    if isupper(S[j]) == True:
        if flg == 1:
            print("WA")
            sys.exit()
        else:
            if S[j] == "C":
                if len(S) == 4:
                    if j != 2:
                        print("WA")
                        sys.exit()
                    flg = 1
                else:
                    if 2 <= j <= len(S) - 2:
                        flg = 1

                    else:
                        print("WA")
                        sys.exit()

if flg != 1:
    print("WA")
    sys.exit()

print("AC")

Solution (Python):
import sys

s = input()

hasC = False
hasA = False
for i in range(len(s)):
    if i == 0 and s[i] == 'A' and not hasA:
        hasA = True
        continue
    if i >= 2 and i <= len(s)-2 and s[i] == 'C' and not hasC:
        hasC = True
        continue
    if s[i].islower(): continue

    print("WA")

    sys.exit()


if hasC and hasA: print("AC")
else : print("WA")

Solution (Python):
S = input()

if S[0] != "A":
    print("WA")
else:
    listC = []
    for i in range(2,len(S)-1):
        if S[i] == "C":
            listC.append(i)
    if len(listC) != 1:
        print("WA")
    else:
        listS = list(S)
        listS.pop(listC[0])
        listS.pop(0)
        S = "".join(listS)
        if S.islower():
            print("AC")
        else:
            print("WA")

Solution (Python):
def check(s):
    t=True
    if s[0]!="A" :
        t=False
        
    a=s[2:len(s)-1]
    
    count=0
    for i in range(len(a)):
        if a[i]=="C":
            count+=1
    if count!=1:
        t=False
    alph="BDEFGHIJKLMNOPQRSTUVWXYZ"
    for i in range(24):
        if alph[i] in s:
            t=False
            break
    if t:
        print("AC")
    else:
        print("WA")
s=input()
check(s)

Solution (Python):


def main():
    s = input()

    if s[0] == 'A':
        s = s.replace('A', 'a', 1)
        if s[2:-1].count('C') == 1:
            temp = s[2:-1].replace('C', 'c', 1)
            ans = s[:2] + temp + s[-1]
            if ans.islower():
                print('AC')
                exit()
    print('WA')

if __name__ == '__main__':
    main()

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

if s[0] == "A" and s.count("A") == 1:
    checklist = []
    for i in range(2,len(s)-1):
        checklist.append(s[i])
        
    if checklist.count("C") == 1:
        s.remove("A")
        s.remove("C")
        p = ""
        for i in s:
            p = p + i
        if p.islower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
s = str(input())
s_list = list(s)
ans_1 = 'no'
ans_2 = 'no'
ans_3 = 'ok'
check = 'no'
s_list_len = len(s_list)
if s_list[0] == 'A':
    ans_1 = 'ok'
count = 0
for i,j in enumerate(s_list[2:s_list_len-1]):
    if j == 'C':
        count += 1
        if check == 'no':
            s_list.pop(2+i)
        check = 'yes'
if count == 1:
    ans_2 = 'ok'
for i in s_list[1:]:
    if not i.islower():
        ans_3 = 'no'
if (ans_1 == 'ok') and (ans_2 == 'ok') and (ans_3 == 'ok'):
    print('AC')
else:
    print('WA')

Solution (Python):

s=input()
count=True
dumy=0
for i in range(len(s)):
  if(s[i]>="A" and s[i]<="Z"):
    dumy+=1
if(dumy!=2):
  count=False
dumy=0
if(s[0]=="A"):
  for i in range(2,len(s)-1):
    if(s[i]=="C"):
      dumy+=1
else:
  count=False
if(dumy!=1):
  count=False
if(count==False):
  print("WA")
else:
  print("AC")

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

Solution (Python):

s=list(input())

f=1

if not s[0]=="A":
    f=-1

b=s[2:len(s)-1]

c=0

for i in range(len(b)):
    if b[i]=="C":
        c+=1
    else:
        if not b[i].islower():
            f=-1

if not c==1:
    f=-1

if not s[1].islower():
    f=-1
  
if not s[len(s)-1].islower():
    f=-1
      
if f>0:
    print("AC")
else:
    print("WA")

Solution (Python):
S = input()

temp = S[2:-1]
count_c=temp.count("C")
if S[0] == "A" and count_c == 1:
    tempS=list(S)
    del tempS[0]
    del tempS[tempS.index("C")]
    tempS = "".join(tempS)
    if tempS.islower():
        print("AC")
    else:
        print("WA")
    
    
else:
    print("WA")

Solution (Python):
def main():
  S = input()
  
  if S[0] != 'A':
    print("WA")
    return
  if S[1].isupper() or S[-1].isupper():
    print("WA")
    return
  cnum = 0
  for i in S[1:-1]:
    if i == 'C':
      cnum +=1
    elif i.isupper():
      print("WA")
      return
  if cnum == 1:
    print("AC")
  else:
    print("WA")

main()

Solution (Python):
s = input()

if s[0] == 'A' and s[2:-1].count('C') == 1:
    c_idx = s[2:-1].index('C') + 2
    ss = [c for c in s]
    ss[0] = ''
    ss[c_idx] = ''
    s = ''.join(ss)
    if s.islower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Solution (Python):
import re

point1 = 0
count1 = 0
point2 = 0
point3 = 0
	
S = input()
l = len(S)
if S[0]=='A':
	point1+=1
for n in range(2,l-1):
	if S[n]=='C':
		count1+=1
if count1==1:
	point2+=1
	
SS = re.sub("A","",S)
SS = re.sub("C","",SS)
if SS.islower():
	point3+=1
	
xx = point1+point2+point3

if xx==3:
	print('AC')
else:
	print('WA')

Solution (Python):


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

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

    for i in range(1, len(S)):
        if i == c_i:
            continue
        if not (97 <= ord(S[i]) and ord(S[i]) <= 122):
            print("WA")
            exit()

    print("AC")

Solution (Python):
class Solution:

    def check(self):
        s = input()
        if s[0] != "A":
            return 'WA'
        if s[2:len(s) - 1].count("C") != 1:
            return "WA"
        ncount = 0
        for i in s:
            if "A" <= i <= "Z":
                ncount += 1
        if ncount > 2:
            return "WA"
        return "AC"


print(Solution().check())

Solution (Python):
s = input()

s_list=list(s)

C_num=-1

if (s_list[0]!="A"):
  print("WA")
else:
  nagasa=len(s_list)

  num=0
  for i in range(2,nagasa-1):
    if s_list[i]=="C":
      num += 1
      C_num=i

  if num!=1:
    print("WA")
  else:
    del s_list[0]
    del s_list[C_num-1]
    mojiretu = ''.join(s_list)
    if(mojiretu.islower()==True):
      print("AC")
    else:
      print("WA")

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

s = ns().rstrip()
ok = False
if s.startswith("A"):
    if s[2:-1].count("C") == 1:
        ct = 0
        for c in s:
            if "a" <= c <= "z":
                ct += 1
        if ct == len(s)-2:
            ok = True
print("AC" if ok else "WA")

Solution (Python):
s = input()
flag = 0
flag1 = 0
flag2 = 0
count1 = s.find('A')
if count1 == -1:
	flag = 1
if flag == 0:
	if s.index('A') != 0:
		flag = 1
if flag == 0:
	s = '1' + s[1:]

count2 = s.find('C')
if count2 > 1 and count2 < len(s) - 1: 
	flag1 = 0
else:
	flag1 = 1

if flag1 == 0:
	s = s[:count2] + '2' + s[count2 + 1:]


if s.find('A') != -1:
	flag2 = 1
if s.find('C') != -1:
	flag2 = 1
if s.find('B') != -1:
	flag2 = 1
if s.find('D') != -1:
	flag2 = 1
if s.find('E') != -1:
	flag2 = 1
if s.find('F') != -1:
	flag2 = 1
if s.find('G') != -1:
	flag2 = 1
if s.find('H') != -1:
	flag2 = 1
if s.find('I') != -1:
	flag2 = 1
if s.find('J') != -1:
	flag2 = 1
if s.find('K') != -1:
	flag2 = 1
if s.find('L') != -1:
	flag2 = 1
if s.find('M') != -1:
	flag2 = 1
if s.find('N') != -1:
	flag2 = 1
if s.find('O') != -1:
	flag2 = 1
if s.find('P') != -1:
	flag2 = 1
if s.find('Q') != -1:
	flag2 = 1
if s.find('R') != -1:
	flag2 = 1
if s.find('S') != -1:
	flag2 = 1
if s.find('T') != -1:
	flag2 = 1
if s.find('U') != -1:
	flag2 = 1
if s.find('V') != -1:
	flag2 = 1
if s.find('W') != -1:
	flag2 = 1
if s.find('X') != -1:
	flag2 = 1
if s.find('Y') != -1:
	flag2 = 1
if s.find('Z') != -1:
	flag2 = 1

if flag == 1 or flag1 == 1 or flag2 == 1:
	print('WA')
else:
	print('AC')

Solution (Python):
a = list(input())
k = 0
for i in range(len(a)):
	if i == 0 and a[i] != "A":
		k = 1
		break
	elif i == 0:
		k = k
	elif i >= 2 and i <= len(a)-2:
		if a[i] == "C":
			k += 2
		elif a[i] <= "z" and a[i] >= "a":
			k = k
		else:
			k = 1
			break
	else:
		if a[i] <= "z" and a[i] >= "a":
			k = k
		else:
			k = 1
			break
if k == 2:
	print("AC")
else:
	print("WA")

Solution (Python):



 
import sys
import math



 

fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile


mod=1000000007
 

def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 

s=str(input())
ans="AC"
if(s[0]!="A"):
    ans="WA"
c=0
index=-1
for i in  range(2,len(s)-1):
    if(s[i]=="C"):
        c+=1
        index=i
if(c!=1):
    ans="WA"

for i in range(len(s)):
    if(ord(s[i])<ord('a')):
        
        if(i!=0 and i !=index):
            ans="WA"
print(ans)

    
    

if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

Solution (Python):
s = input()

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

Solution (Python):
Ss = input()

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

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

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

if s[0] == "A":
    s.remove("A")
    if cnt_c > 0:
        s.remove("C")
    if cnt_c == 1 and str(s).islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

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

Solution (Python):
S = input()
ans = cond1 = cond2 = cond3 = cond4 = True
if S[0] != "A":
    cond1 = False
T = [S[i] for i in range(len(S)) if i>=2 and i<=len(S)-2]
U = [S[i] for i in range(len(S)) if i!=0]

count = 0
index = -1
for i in range(len(T)):
    if T[i] == "C":
        count+=1
        index = i
    else:
        if not T[i].islower():
            cond3 = False
cond2 = count == 1
for i in range(len(S)):
    if i==1 or i==len(S)-1:
        if not S[i].islower():
            cond4 = False
    

ans = cond1 and cond2 and cond3 and cond4

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

Solution (Python):


S = input()

if S[0] == "A" and S[2:-1].count("C") == 1:
    S = list(S)
    for i in range(len(S)):
        if not S[i].islower() and S[i] != "A" and S[i] != "C":
            print("WA")
            exit()
    print("AC")
else:
    print("WA")

Solution (Python):
from collections import Counter
import sys

s = input()
counter = Counter(s[2:-1])

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

if counter['C'] == 1:
    s = s.replace('C', '')
else:
    print('WA')
    sys.exit(0)

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

Solution (Python):
S = list(input())
flag = True
flag_t = False

if S[0] == "A":

    S_part = S[2:-1]
    

    count = 0
    for i, str in enumerate(S_part):
        if str == "C":
            ind = i
            
            count += 1

    if count == 1:
        
        S.pop(0)
        S.pop(ind + 1)
        

        for str in S:
            if not str.islower():
                flag = False

        if flag:
            print("AC")
            flag_t = True

if flag_t == False:
    print("WA")

Solution (Python):




S=input()
x=0
count=0

if S[0]!="A":
    print("WA")
    exit()
elif len(S)==4:
    if S[2]!="C":
        print("WA")
        exit()
    elif S[1].islower() and S[3].islower():
        print("AC")
        exit()
    else:
        print("WA")
        exit()
else:
    for i in range(2,len(S)-1):
        if S[i]=="C":
            count+=1
            x=i
    
    if count!=1:
        print("WA")
        exit()
    elif count==1:
        for i in range(1,len(S)):
            if x!=i:
                if S[i].isupper():
                    print("WA")
                    exit()
        print("AC")
        exit()

Solution (Python):
S = list(input())
N = 0
num = 0
answer = False

if S[0] == 'A':
    del S[0]
    for i in range(1, len(S)-1):
        if S[i] == 'C':
            num += 1
            N = i
    if num == 1:
        del S[N]
        SS = ''.join(S)
        answer = SS.islower()
        
if answer == True:
    print('AC')
elif answer == False:
    print('WA')

Solution (Python):
S = input()
flag = 'WA'
if S[0] == 'A':
    ss = S[1]
    s = S[2:]
    cnt_c = 0
    for i in range(len(s)-1):
        m = s[i]
        if m == 'C':
            cnt_c += 1
            
            m = 'c'
        ss += m
    ss += s[-1:]
    
    if cnt_c == 1 and ss.islower():
        flag = 'AC'

print(flag)

Solution (Python):
def main():
    s = input().strip()

    c = 0
    for i in range(len(s)):
        if i == 0:
            if s[i] != 'A':
                print('WA')
                return
        elif i == 1 and not s[i].islower():
            print('WA')
            return
        elif 2 <= i and i <= len(s) - 2:
            if s[i] == 'C':
                c += 1
            else:
                if not s[i].islower():
                    print('WA')
                    return
        else:
            if not s[i].islower():
                print('WA')
                return
        
    if c != 1:
        print('WA')
        return
        
    print('AC')


if __name__ == '__main__':
    main()

Solution (Python):
S = input()

yes = S[0] == 'A' and \
      1 == sum(1 for c in S[2:-1] if c == 'C') and \
      2 == sum(1 for c in S if 'A' <= c <= 'Z')
print('AC' if yes else 'WA')

Solution (Python):
s = list(input())
if s[0]=="A":
  s[0] = "a"
  flag = False
  for i, ele in enumerate(s[2:-1], 2):
    if ele == "C":
      s[i] = "c"
      flag = True
      break
  if flag and str(s).islower():
    print("AC")
  else:
    print("WA")
else:
  print("WA")

Solution (Python):
S=input()

endflag=0
count=0
for num,i in enumerate(S):
    if num==0:
        if S[0]!="A":
            print("WA")
            endflag=1
    elif i=="C":
        if num<2 or num>=(len(S)-1) or count>0:
            print("WA")
            endflag=1
        else:
            count+=1
    elif i.islower() == False:
        print("WA")
        endflag=1

    if endflag==1:
        break
if endflag==0:
    if count==1:
        print("AC")
    else:
        print("WA")

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

Solution (Python):
S = input()
lcnt = 0
for i in range(len(S)):
    if "A" <= S[i] and S[i] <= "Z":
        lcnt += 1
ccnt = 0
for i in range(2, len(S) - 1):
    if S[i] == "C":
        ccnt += 1
if S[0] != "A":
    print("WA")
elif ccnt != 1:
    print("WA")
elif lcnt != 2:
    print("WA")
else:
    print("AC")

Solution (Python):
S=input()
if S[0] != 'A' or S[1] <= 'Z' or S[-1] <= 'Z':
  print('WA')
  quit()
n = 0
for i in range(2, len(S)-1):
  if S[i] > 'Z':
    pass
  elif S[i] == 'C':
    n += 1
  else:
    n =2
if n != 1:
  print('WA')
else:
  print('AC')

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

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

def judge(s):
    if s[0] != 'A': return 'WA'
    elif s[2:-1].count('C') != 1: return 'WA'
    del s[s[2:-1].index('C')+2]
    del s[0]
    s=''.join(s)
    if s.lower()==s: return 'AC'
    else: return 'WA'
        
print(judge(s))

Solution (Python):
s=list(input())
ans='AC'
a=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
if s[0]=='A' and s[2:-1].count('C')==1 and s[1]!='C' and s[-1]!='C':
    s.remove('C')
    del s[0]
    for i in range(len(s)):
        if s[i] not in a:
            ans='WA'
            break
else:
    ans='WA'
print(ans)

Solution (Python):
def has_capital_c(string):
    
    
    if string[2:-1].find('C') != -1 and string[2:-1].count('C') == 1:
        return True
    else:
        return False

def is_lower_case_except_a_c(string):
    return string.replace('A','').replace('C','').islower()

S = input()



if S[0]=='A' and has_capital_c(S) and is_lower_case_except_a_c(S):
    print('AC')
else:
    print('WA')

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

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

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

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

def func(S):
    if S[0] != 'A':
        return 'WA'

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

    for s in [s for s in S if s != 'A' and s!= 'C']:
        if s.isupper():
            return 'WA'
    
    return 'AC'

print(func(S))

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

flag = 0
flag2 = 0

for i in range(len(S)):
  if i == 0:
    if S[i] != "A":
      print("WA")
      flag2 = 1
      break
  elif i == 1:
    if ord(S[i]) >= 65 and ord(S[i]) <= 90:
      print("WA")
      flag2 = 1
      break
  elif i >= 2 and i <= len(S) - 2:
    if ord(S[i]) >= 65 and ord(S[i]) <= 90:
      if flag == 0:
        if S[i] == "C":
          flag = 1
        else:
          print("WA")
          flag2 = 1
          break
      else:
        print("WA")
        flag2 = 1
        break
  else:
      if ord(S[i]) >= 65 and ord(S[i]) <= 90:
        print("WA")
        flag2 = 1
        break

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

Solution (Python):
s = input()
t = s[2:-1]
count = 0
q = [s[1]]
for i in range(len(t)):
    if t[i] == "C":
        count += 1
    else:
        q.append(t[i])
q.append(s[-1])
q =''.join(q)
if s[0] == "A" and count == 1 and str(q).lower() ==str(q):
    print("AC")
else:
    print("WA")

Solution (Python):
s = input()

def check(s):
  if s[0] != 'A':
    print('WA')
    return
  
  if s[2:-1].count('C') != 1:
    print('WA')
    return
  
  s = s.strip('A')
  s = list(s)
  s.remove('C')
  s = ''.join(s)
  
  if s.islower() != True:
    print('WA')
    return
  
  print('AC')

check(s)

Solution (Python):
S = input()

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

print('WA')

Solution (Python):
s = input()
s1 = ''
judge = False
if s[0] == 'A':
    for i in range(1,len(s)):
        s1 += s[i]
    jc = 0
    for i in range(1, len(s1)-1):
        if s1[i] == 'C':
            jc += 1
            s2 = ''
            for j in range(len(s1)):
                if j != i:
                    s2 += s1[j]
    if jc == 1:
        judge = True
    if judge:
        if s2.islower():
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Solution (Python):
S = list(input())
count = 0
pop = 0
AC = 0
    
for i in range(2,len(S)-1):
    if S[i] == 'C':
        count = count + 1
        pop = i
    
if S[0] == 'A':
    if count == 1:
        S[0] = 'a'
        S[pop] = 'c'
        m = ''.join(S)
        if str.islower(m):
            print('AC')
            AC = 1
            
            
if AC != 1:
    print('WA')

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


def solve(strings):
    if strings[0] != "A":
        return 'WA'

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

    for s in strings:
        if s != 'A' and s != 'C':
            if s.isupper():
                return 'WA'

    return 'AC'


print(solve(S))

Solution (Python):


S = input()

wa = 0

if S[0] == "A":
    pass
else:
    wa = 1

n = 0
for i in S[2:-1]:
    if i == "C":
        n = n + 1
if n == 1:
    pass
else:
    wa = 1 


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

if n == 2:
    pass
else:
    wa = 1        

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

Solution (Python):
s = input()

ccount = 0;
i = 0

for c in s:
    if i == 0:
        if c != "A":
            print("WA")
            exit()
    elif 2 <= i and i <= len(s) - 2 and c == "C":
        if ccount >= 1:
            print("WA")
            exit()
        ccount = ccount + 1
    else:
        if c.isupper():
            print("WA")
            exit()
    i += 1

print("AC" if ccount == 1 else "WA")

Solution (Python):



def main():
    s = input()
    c_count = 0
    s0 = s[0]

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

    s = s.replace('A', '', 1)
    s = s.replace('C', '', 1)
    result = s.islower()

    if s0 == 'A' and c_count == 1 and result is True:
        print('AC')
    else:
        print('WA')


if __name__ == '__main__':
    main()

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

ok = S[0] == "A"
SL[0] = "a"

ok = ok and (S[2:-1].count("C") == 1)
cpos = S[2:-1].find("C")

if cpos != -1:
    SL[2+cpos] = "c"

for c in SL:
    ok = ok and not c.isupper()

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

Solution (Python):
import numpy as np

l = list(input())
l = np.array(l)


state = 'AC'

if l[0] != 'A':
    state = 'WA'
else:
    l[0] = 'a'
    l2 = l[2:-1].copy()
    Cplace = np.where(l2=='C')[0]

    if len(Cplace) == 1:
        l2[Cplace[0]] = 'c'
        l[2:-1] = l2
        arr = ''.join(l)
        if not arr.islower():
            state = 'WA'

    else:
        state = 'WA'

print(state)

Solution (Python):
import sys

s = input()

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


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

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

for i in range(1, len(s)):
    if i != pos and s[i].isupper():
        print('WA')
        sys.exit(0)

print('AC')

Solution (Python):
S = list(str(input()))
 
if S[0] != "A":
  print("WA")
else:
  l = len(S)
  c = 0
  x = 0
  for i in range(2,l-1):
    if S[i] == "C":
      c += 1
      x = i
  if c !=1:
    print("WA")
  else:
    del S[x]
    del S[0]
    c = 0
    for i in S:
      if i.isupper():
        c += 1
    if c == 0:
      print("AC")
    else:
      print("WA")

Solution (Python):
S = input()
ans = True
if S[0]!='A':
    ans = False
    print("WA")
else:
    S = S.replace('A', '')

if ans:
    tmp = False
    for c in S[1:-1]:
        if c=='C':
            if not tmp:
                tmp = True
            else:
                ans = False
                print("WA")
                break
    if not tmp:
        ans = False
        print("WA")

if ans:
    S = S.replace('C', '')

if ans:
    tmp = True
    for c in S:
        if not (ord(c)>=97 and ord(c)<123):
            tmp = False
    if not tmp:
        print("WA")
        ans = False

if ans:
    print("AC")

Solution (Python):
import re
import sys

def check_upper_char(string):
    result = re.search('[A-Z]', string)
    return True if result else False

def in_onec(s):
    cnt = 0
    for i in range(len(s)):
        if s[i] == 'C':
            cnt += 1

    if cnt == 1:
        return True
    else:
        return False

s = input()

sub_s = s[2:-1]

if (s[0] == 'A') and in_onec(sub_s):
    s = s.replace('A', '')
    s = s.replace('C', '')
    if not check_upper_char(s):
        print('AC')
        sys.exit()
print('WA')

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

for i in s:
    if ord("A") <= ord(i) <= ord("Z"):
        count += 1
else:
    if s.count("C") == 0:
        print("WA")
        exit()
    if s[0] == "A" and 2 <= s.index("C") <= len(s)-2 and count == 2:
        print("AC")
    else:
        print("WA")

Solution (Python):
a=input()
flag=0
if a[0]=='A':
    i=1
    c=0
    while i<len(a):
        if i>=2 and i<=len(a)-2 and a[i]=='C' and c==0:
            i+=1
            c=1
        elif ord(a[i])>=97 and ord(a[i])<=122 and a[i]!='C':
            i+=1
        else:
            flag=1
            break
    if flag==0 and c!=0:
        print("AC")
    else:
        print("WA")
else:
    print("WA")

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

a = s[0:2]
b = s[2:-1]
c = s[-1:]





if a[0] == 'A':
    if b.count('C') == 1:
        a = a.replace('A', '', 1)
        b = b.replace('C', '', 1)
        s = a+b+c
        if s.islower() == True:
            flag = 1

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

Solution (Python):
s = input()
a = 1
b = 0
c = 0
if s[0] == "A":
    a = a * 1
else:
    a = a * 0
if s[1] != "C":
    for i in range(2, len(s) - 1):
        if s[i] == "C":
            b = b + 1
            if c == 0:
                c = i
    if b == 1:
        a = a * 1
    else:
        a = a * 0
else:
    a = a * 0

ss = s[1:c] + s[c + 1:len(s) + 1]

if ss.islower():
    a = a * 1
else:
    a = a * 0

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

Solution (Python):
import re

S = input()


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

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

if a[0]=="A":
    if "C" in a[2:len(a)-1]:
        ad = a[1:].replace("C","")
        if len(ad)==len(a)-2:
            if ad.islower():
                print("AC")
            else:
                print("WA")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

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

Solution (Python):
S=input()
is_ans=0
if S[0]=='A':
    S1=S[2:len(S)-1]
    if S1.count('C')==1:
        S0=list(S)

        S0.remove('A')
        S0.remove('C')

        S3=''.join(S0)
        S3=S3.lower()
        S3=list(S3)
        if S3==S0:
            is_ans=1
print("AC" if is_ans else "WA")

Solution (Python):
x = input()
ans = 0
if x[0] == "A":
    if "C" in x[2:len(x)-1]:
        x=x.replace("A","",1)
        x=x.replace("C","",1)
        if x.islower():
            ans = 1

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

Solution (Python):

S = input()

result = 'WA'
if S[0] == 'A':
    if S[2:-1].count('C') == 1:
        if len([x for x in S if x.islower()]) == len(S) -2:
            result = 'AC'


print(result)

Solution (Python):

import re
s=input()

if s[0]=='A' and s[2:-1].count('C')==1 and len(re.findall('[A-Z]',s))==2:
    print('AC')
    exit()

print('WA')
exit()

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

if S[0] != "A":
    print("WA")
else:
    if len(S) == 4:
        if S[2] == "C" and S[3].islower() and S[1].islower():
            print("AC")
        elif S[3] == "C" and S[2].islower() and S[1].islower():
            print("AC")
        else:
            print("WA")
    else:
        s = S[2:-1]
        if "C" not in s:
            print("WA")
        else:
            counter = 0
            for i in S[1:]:
                if i.isupper():
                    counter += 1
            if counter == 1:
                print("AC")
            else:
                print("WA")

Solution (Python):
import re

S = input()
m = re.match('^A[a-z]+C[a-z]+$', S)
if m == None:
    print('WA')
else:
    print('AC')