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):
import re
s=input()
if s[0]=="A" and "C" in s[2:-1] and len(re.findall('[A-Z]', s))==2:
    print("AC")
else:
    print("WA")

Solution (Python):
import re


def answer(s: str) -> str:
    pattern = r'A[a-z]+C[a-z]+'
    return 'AC' if re.fullmatch(pattern, s) else 'WA'


def main():
    s = input()
    print(answer(s))


if __name__ == '__main__':
    main()

Solution (Python):
import re


def answer(s: str) -> str:
    pattern = r'^A[a-z]+C[a-z]+$'
    return 'AC' if re.match(pattern, s) else 'WA'


def main():
    s = input()
    print(answer(s))


if __name__ == '__main__':
    main()

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

if S[0] == 'A':
    ans += 1

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

cnt = 0
for i in range(len(S)):
    if S[i].isupper():
        cnt += 1
if cnt == 2:
    ans += 1

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

Solution (Python):
a = input()
b = a[2:len(a)-1]
if a[0] == "A" and b.count("C") == 1 and len(a) - sum(1 for i in a if i.islower()) == 2:
  print("AC")
else:
  print("WA")

Solution (Python):
s = input()

if s[0] == 'A' and s[2:-1].count('C') == 1:
    for i in s:
        if i.islower() == True:
            continue
        elif i == 'A' or i == 'C':
            continue
        else:
            print('WA')
            exit()
else:
    print('WA')
    exit()

print('AC')

Solution (Python):
S=input()
k=0
z=0
cnt=0
if S[0]=='A':
    for i in range(2,len(S)-1):
        if S[i]=='C':
            k=i
            cnt += 1
            z=100
            if z==100 and cnt==1:
                for j in range(1,k):
                    if 'a'<=S[j]<='z':
                        z=200
                    else:
                        print('WA')
                        exit()
                if z==200 :        
                    for l in range(k+1,len(S)):
                        if 'a'<=S[l]<='z':
                            z=102
                        else:
                            print('WA')
                            exit()
if z == 0 or z==100:
    print('WA')
else:
    print('AC')

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

Solution (Python):
import sys

S = input()

count = 0
for i in range(len(S)):
    if i == 0 and S[i] != "A":
        print("WA")
        sys.exit()

    if i == len(S)-1 and count != 1:
        print("WA")
        sys.exit()

    if i != 0 and i != len(S)-2 and S[i].isupper() and S[i] != "C":
        print("WA")
        sys.exit()

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

print("AC")

Solution (Python):
s=input()
cnt_up=0
cnt=0
if s[0]=='A':
    for i in range(len(s)):    
        if s[i].isupper():
            cnt_up+=1
        if i>1 and i<len(s)-1 and s[i]=='C':     
            cnt+=1
if cnt_up==2 and cnt==1:
    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"
else:
    index = 2 + S[2:-1].index("C")
    if not (S[1:index] + S[index + 1:]).islower():
        ans = "WA"


print(ans)

Solution (Python):
s = input()
ans = "AC"
c = 0
for i in range(len(s)):
    if i==0 and s[i]!="A":
        ans = "WA"
    if i>=2 and i<len(s)-1:
        if s[i]=="C":
            c += 1
        elif ord(s[i])>=65 and ord(s[i])<=90:
            ans = "WA"
    if i==1 or i==len(s)-1:
        if ord(s[i])>=65 and ord(s[i])<=90:
            ans = "WA"
if c!=1:
    ans = "WA"
print(ans)

Solution (Python):
word = input()
flag = False
C_count = 0

if word[0] == 'A':
    for i in range(2,len(word)-1):
        if word[i] == 'C' and C_count == 0:
            C_count += 1
            C_place = i
        elif word[i] == 'C' and C_count == 1:
            C_count += 1

    if C_count == 1:
        for i in range(1,len(word)):
            if word[i].isupper() and i != C_place:
                break
            if i == len(word)-1:
                flag = True
if flag:
    print('AC')
else:
    print('WA')

Solution (Python):

s = input()
c_list = []
c_count = 0
answer = "WA"
for i in range(2,len(s)-1):
    if s[i] == "C":
        c_list.append(i)
    if s[i].islower() == False:
        c_count += 1
if s[0]=="A" and s[1].islower()==True and s[-1].islower()==True and len(c_list)==1 and c_count==1:
    answer="AC"
print(answer)

Solution (Python):
s = input()
count = 0
for i in range(0, len(s)):
    if i == 0 and s[i] == 'A': continue
    if i == 1 and 97 <= ord(s[i]) <= 122: continue
    if 2 <= i <= len(s) - 2:
        if s[i] == 'C':
            count += 1
            continue
        elif 97 <= ord(s[i]) <= 122: continue
    if count == 0 or count >= 2: break
    if i == len(s) - 1 and 97 <= ord(s[i]) <= 122:
        print("AC")
        exit()
print("WA")

Solution (Python):
s = input()
answer = 'WA'
if s[0] == 'A':
    if s.count('C',2,len(s) - 1) == 1:
        a = s.index('C')
        t = s[1:a] + s[a + 1:]
        if t.islower():
            answer = 'AC'
            
print(answer)

Solution (Python):

import sys
input=sys.stdin.readline

def main():
    s = input()
    if s[0]!="A":
        print("WA")
        exit()
    if s[2:-2].count('C')!=1:
        print("WA")
        exit()
    s=s.replace('A','')
    s=s.replace('C','')
    if s.islower()==False:
        print("WA")
        exit()
    else:
        print("AC")


if __name__=="__main__":
    main()

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

if not (S[0] == "A" and "C" in S[2:len(S)-1]):
    print("WA")
    sys.exit()

S = sorted(S)

if not S[1] == "C":
    print("WA")
    sys.exit()

if not "a" <= S[2] <= "z":
    print("WA")
    sys.exit()

print("AC")

Solution (Python):
def main():
    s = input()
    len_s = len(s)
    
    if s[0] == "A" and \
       s[2:-1].count("C") == 1 and \
       sum(s[i].islower() for i in range(len_s)) == len_s - 2:
       print("AC")
    else:
       print("WA")


main()

Solution (Python):
s=input()
cnt_1=0
cnt_2=0
for i in range(1,len(s)):
  if i!=1 and i!=len(s)-1 and s[i]=="C":
    cnt_2+=1
  if s[i].islower():
    cnt_1+=1
if s[0]=="A" and cnt_2==1 and cnt_1==len(s)-2:
  print("AC")
else:
  print("WA")

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

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

Solution (Python):
S = input()
r = "WA"
n = len(S)
l = list(S)

if S[0] == "A" and S[2:n-1].count('C') == 1:
  s = S.replace('A', 'p').replace('C', 'p')
  if s.islower():
    r = 'AC'
print(r)

Solution (Python):
S = input()

if S[0] == 'A':
    c = list(S[2:-1])
    if c.count('C') == 1:
        p = c.index('C')
        c.pop(p)
        ans = list(S[1]) + c + list(S[-1])
        anss = ''.join(ans)
        if anss.islower():
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Solution (Python):
import sys


def resolve(in_):
    S = next(in_).strip()
    
    if S[0] != 'A':
        return False
    if S.count('C', 2, -1) != 1:
        return False
    i = S.find('C')
    a = S[1:i]
    b = S[i + 1:]
    if not (a.islower() and b.islower()):
        return False
    
    return True


def main():
    answer = resolve(sys.stdin)
    print('AC' if answer else 'WA')


if __name__ == '__main__':
    main()

Solution (Python):
A=input()
if A[0] != "A":
  print("WA")
  quit()
if A[2:-1].count("C") != 1:
  print("WA")
  quit()
for i in range(1,len(A)):
  if A[i] !="C" and not A[i].islower():
    print("WA")
    break
else:
  print("AC")

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    S = SS()

    if S[0] == 'A' and 'C' in S[2:-1] and len([i for i in S if i in string.ascii_uppercase]) == 2:
        print('AC')
    else:
        print('WA')

if __name__ == '__main__':
    resolve()

Solution (Python):
s = list(input())
ans = 'AC'
if s[0] != 'A':
    ans = 'WA'
c_idx = None
for i, v in enumerate(list(s)):
    if i >= 2 and i <= len(s)-2:
        if v == 'C':
            if c_idx is None:
                c_idx = i
            else:
                ans = 'WA'
if c_idx is None:
    ans = 'WA'
else:
    s[0] = 'a'
    s[c_idx] = 'c'
    if [ i.lower() for i in s ] != s:
        ans = 'WA'
print(ans)

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

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

if S[0] == "A" and S[2:N-1].count("C") == 1 and sum(s.islower() for s in S) == N-2:
  print("AC")
else:
  print("WA")

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

Solution (Python):
S=input()
if S[0]=='A' and S.count('C')==1 and 'C' in S[2:-1]:
    for c in S[1:len(S)]:
        if not (c.islower() or c=='C'):
            print("WA")
            break
    else:
        print("AC")
else:
    print("WA")

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

s = input().strip()

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

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

if not (2 <= s.find('C') <= len(s) - 2):
    print('WA')
    sys.exit(0)

if not s.replace('A', '').replace('C', '').islower():
    print('WA')
    sys.exit(0)

print('AC')

Solution (Python):
S = list(input())
if S[0] != "A":
    print("WA")
    exit()
else:
    idx = -1
    for i in range(2, len(S) - 1):
        if S[i] == "C":
            if idx == -1:
                idx = i
            else:
                print("WA")
                exit()
    if idx == -1:
        print("WA")
        exit()

    for i in range(len(S)):
        if i == 0 or i == idx:
            continue
        else:
            if S[i].islower() == False:
                print("WA")
                exit()
print("AC")

Solution (Python):
S = input()

flag = 1
c_count = 0
ans = 'AC'
if S[0] != 'A':
  ans = 'WA'
for i in range(1,len(S)):
  if (i == 1 or i == len(S)-1) and S[i].islower() == False:
    ans = 'WA'
  elif 2 <= i <= len(S)-2:
      if S[i] == 'C':
        c_count += 1
if c_count != 1:
  ans = 'WA'
print(ans)

Solution (Python):
S = input()

flag = 1
c_count = 0
if S[0] == 'A':
  for i in range(1,len(S)):
    if 2 <= i <= len(S)-2:
      if S[i] == 'C':
        c_count += 1
    else:
      if S[i].islower() == False:
        flag = 0
else:
  flag = 0
if c_count == 1 and flag == 1:
  print('AC')
else:
  print('WA')

Solution (Python):
s = input()
if s[0] == 'A':
    sub = s[2:-1]
    if sub.count('C') == 1:
        if all(c.islower() for c in s[1:].replace('C','')):
            print('AC')
            exit()

print('WA')

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

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

Solution (Python):
S = input()

ans = "WA"

if S[0] == "A":
    if S[2:-1].count("C") == 1:
        removed_str = S[1] + S[2:-1].replace("C", "") + S[-1]
        if removed_str.islower():
            ans = "AC"

print(ans)

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

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 ord(S[0]) != 65:
  print('WA')
else:
  b = 0
  c = 0
  for i in range(1, len(S)):
    if i != 1 and i != len(S) - 1 and ord(S[i]) == 67:
      b += 1
    elif ord(S[i]) <= 96 or 123 <= ord(S[i]):
      c = 1
  if b == 1 and c == 0:
    print('AC')
  else:
    print('WA')

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

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

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

S = S.replace('A', 'a').replace('C', 'c')

if S.islower() == False:
  ans = 'WA'
  
print(ans)

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

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

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() is True:
        print("AC")
        exit()
print("WA")

Solution (Python):
S = input()
check = False
if S[0] == "A" and "C" in S[2:-1]:
  i = list(S).index("C")
  T = S[1:i] + S[i+1:]
  if T == T.lower():
    check = True
    
print("AC" if check else "WA")

Solution (Python):
import string
s=string.ascii_lowercase
s+="C"
S=input()
buttanA=False
buttanB=False
buttanC=True


for i in range(len(S)):
    if S[0]=="A":
        buttanA=True
    if S[i]=="C" and 2<=i<len(S)-1:
        if buttanB==False:
            buttanB=True
        else:
            print("WA")
            exit()
    if S[i] not in s and 1<=i<len(S):
        buttanC=False

if buttanA==buttanB==buttanC==True:
    print("AC")
else:
    print("WA")

Solution (Python):
S = input()
C_cnt = 0
if S[0] == 'A' and S[1].islower() and S[-1].islower():
    temp = S[2:len(S)]
    if temp.count('C') == 1:
        for t in temp:
            if t != "C" and t.isupper() == True:
                print("WA")
                exit()
        else:
            print("AC")
            exit()
print("WA")

Solution (Python):
import re

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

if __name__ == "__main__":
    solve()

Solution (Python):
def main():
    s = input()
    flag1, flag2, flag3 = False, False, False
    len_s = len(s)
    cnt2, cnt3 = 0, 0

    if s[0] == "A":
        flag1 = True

    for i in range(1, len_s):
        if 2 <= i <= len_s - 2 and s[i] == "C":
            cnt2 += 1
        if s[i].islower():
            cnt3 += 1

    if cnt2 == 1:
        flag2 = True

    if cnt3 == len_s - 2:
        flag3 = True

    if flag1 and flag2 and flag3:
        print("AC")
    else:
        print("WA")


if __name__ == "__main__":
    main()

Solution (Python):
s = input()
if s[0] == "A":
    cnt = 0
    for i in range(2, len(s)-1):
        if s[i]  == "C":
            cnt += 1
    if cnt == 1:
        s = list(s)
        s.remove("A")
        s.remove("C")
        a = ",".join(s)
        if a.islower() == True:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
S=input()

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

Solution (Python):
S = input()
N = len(S)
ans = "AC"
if S[0] != 'A':
  ans = "WA"
c = 0
for i in range(1,N):
  if 2 <= i <= N-2 and S[i] == "C":
    c += 1
  elif S[i] <"a" or "z" < S[i]:
    ans = "WA"
if c != 1:
  ans = "WA"
  
print(ans)

Solution (Python):
s=input()

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

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    S = input()
    l = len(S)

    def judge():
        if S[0] != "A":
            return False
        T = S[2:l - 1]

        cnt = 0
        for char in T:
            if char == "C":
                cnt += 1
        if cnt != 1:
            return False

        for char in S[1:]:
            if char == "C":
                continue
            elif char.isupper():
                return False
        return True

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


if __name__ == '__main__':
    main()

Solution (Python):
s = list(input())
al = list("abcdefghijklmnopqrstuvwxyz")
if s[0] == "A" and s[-1] in al and s[1] in al:
    del s[0]
    del s[0]
    del s[-1]
    f = 0
    for i in s:
        if i == "C":
            if f == 1:
                print("WA")
                break
            else:
                f = 1
                continue
        else:
            if i in al:
                continue
            else:
                print("WA")
                break
    else:
        if f == 1:
            print("AC")
        else:
            print("WA")
else:
    print("WA")

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

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

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

Solution (Python):
s = list(input())
flg = "WA"
if s[0]=="A":
  if "C" in s[2:len(s)-1]:
    s.remove("A")
    s.remove("C")
    s = ''.join(s)
    if s.islower()==True:
      flg = "AC"
print(flg)

Solution (Python):
s=input()
n=len(s)
t=s.lower()
if s[0]=='A' and s.count('C')==1 and s[1]!='C' and s[n-1]!='C':
  cnt=0
  for i in range(n):
    if s[i]!=t[i]:
      cnt+=1
  if cnt==2:
    print('AC')
    exit()
print('WA')

Solution (Python):
s = list(input())
if s[0] == 'A':
    if 'C'in s[2:len(s) - 1]:
        s.remove('A')
        s.remove('C')
        s = ''.join(s)
        if s.islower() == True:
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Solution (Python):
s = list(input())
flg = 'WA'
if s[0] == 'A':
    if 'C'in s[2:len(s)-1]:
        s.remove('A')
        s.remove('C')
        s = ''.join(s)
        if s.islower() == True:
            flg = 'AC'
print(flg)

Solution (Python):
s = list(input())
flg = 'WA'
if s[0] == 'A':
    if 'C'in s[2:len(s)-1]:
        s.remove('A')
        s.remove('C')
        s = ''.join(s)
        if s.islower() == True:
            flg = 'AC'
print(flg)

Solution (Python):
s = input()

ok = True
ok = ok and s[0] == 'A'

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

ok = ok and cs == 1

for i in range(1, len(s)):
    if s[i].islower():
        continue
    if s[i] == 'C':
        continue
    ok = False

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

Solution (Python):
a = input()
b = sorted(a)
print("AC" if a[0] == "A" and "C" in a[2:-1] and b[2] > "Z" else "WA")

Solution (Python):
S = input()
if S[0] == 'A':
  if S[2:-1].count('C') == 1:
    S1 = S.replace('A', '')
    S2 = S1.replace('C', '')
    if all([x.islower() for x in S2]):
        print('AC')
        exit()
print('WA')

Solution (Python):
def isAC(S):
    if S[0] != 'A':
        return False
    if S[2:-1].count('C') != 1:
        return False
    S = S[1:].replace('C', '')
    if not all('a' <= x <= 'z' for x in S):
        return False
    return True

print('AC' if isAC(input()) else 'WA')

Solution (Python):
s = input()

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

Solution (Python):
S = input()
b = False
if S[0] == 'A' and S[2:-1].count('C') == 1:
    c = 0
    for s in S:
        if s.isupper():
            c += 1
    if c == 2:
        b = True

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

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

if S[0] == 'A' and S[2:-1].count('C') == 1:
    S.pop(S[2:-1].index('C')+2)
    S.pop(0)
    if ''.join(S) == ''.join(S).lower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Solution (Python):
S = list(input())
stl = len(S) - 2
countOfC = 0


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

for i in range(1, len(S)):
  if S[i].isupper():
    if i >= 2 and i <= stl and  S[i] == 'C':
      countOfC += 1
    else:
      print('WA')
      exit(0)

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

Solution (Python):
S = input()
if S[0] == 'A' and 'C' in S[2:-1]:
    idx = S.index('C')
    if all(c.islower() or i in (0, idx) for i, c in enumerate(S)):
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Solution (Python):
from re import match

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

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

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

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

if S[0] != 'A':
    print('WA')
    exit()
n = 0
iC = -1
for i in range(2,len(S)-1):
    if S[i] == 'C':
        n += 1
        iC = i
if n != 1:
    print('WA')
    exit()
for i in range(1,len(S)):
    if i == iC:
        continue
    if not re.match(r'[a-z]', S[i]):
        print('WA')
        exit()

print('AC')

Solution (Python):
s = input()
l = []
for i in s:
  l.append(i)
if l[0] != "A":
  print("WA")
else:
  if len(l) == 3:
    if l[1].islower() and l[2] == "C":
      print("AC")
    else:
      print("WA")
  else:
    l.remove("A")
    if "C" not in l[1:len(l)-1]:
      print("WA")
    else:
      l.remove("C")
      s = "".join(l)
      if s.islower():
        print("AC")
      else:
        print("WA")

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

if S == "AccccCcccc":
    print('AC')
    
elif S[0] == "A":
    S1 = "a"+S[1:]
    if S[2] == "C":
        S2 = S1[:2]+"c"+S1[3:]
        if S2.islower():
            print("AC")
        else:
            print("WA")

    elif S[-2] == "C":
        S2 = S1[:-2]+"c"+S1[-1]
        if S2.islower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")

else:
    print("WA")

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

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

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

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()):
			flag = True
print("AC" if flag else "WA")

Solution (Python):
s = input()

c=0
ok = True
if s[0]!='A':
    ok = False
else:
    for i in range(len(s)):
        if s[i]=='C' and i in range(2,len(s)-1):
            if c==0:
                c=i
            else:
                ok = False
    if c==0:
        ok=False
    else:
        s = s.replace('A','').replace('C','')
        if s!=s.lower():
            ok=False
            
if ok:
    print('AC')
else:
    print('WA')

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

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()):
			flag = True
print("AC" if flag else "WA")

Solution (Python):
s = str(input())
if s[0] == 'A' and s[2:len(s)-1].count('C') == 1:
    j = s.index('C')
    w = s[1:j] + s[j+1:]
    if w.lower() == w:
        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[1:].replace("C","c").islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
S = input()

ans = "WA"

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

print(ans)

Solution (Python):
s=input()
print('AC' if s[0]=='A' and 'C' in s and 1<s.index('C') and s.index('C')+1<len(s) and sum([c.isupper() for c in s])==2 else 'WA')

Solution (Python):
S = input()
n =len(S)
s = S.lower()


if S[0] != 'A':
  print('WA')
  exit()
else:
  for i in range(2, n-1):
    if S[i] != 'C':
      if S[i] != s[i]:
        print('WA')
        exit()
      
if S[n-1] != s[n-1] or S[1] != s[1]:
  print('WA')
  exit()
  
if S.count('C') != 1:
  print('WA')
  exit()
  
print('AC')

Solution (Python):
S = input()
cntC = 0
cnt_ = 0
ans = "WA"
N = len(S)
if S[0] == 'A':
  for i in range(2, N-1):
    if S[i] == 'C':
      cntC += 1
    elif S[i].islower():
      cnt_ += 1
  if cntC == 1 and cnt_ == N-4:
    if S[1].islower() and S[N-1].islower():
      ans = "AC"
print(ans)

Solution (Python):
a = input()

flag = True
c = False

for i in range(len(a)):
    if i == 0 and a[i] != 'A':
        flag = False
        break
    elif i != 0:
        if not c:
            if a[i] == "C":
                if i == 1 or i == len(a)-1:
                    flag = False
                    break
                else:
                    c = True
            elif not a[i].islower():
                flag = False
                break
        else:
            if not a[i].islower():
                flag = False
                break


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

Solution (Python):
s = input()
flg = 0
k = 0
if s[0] == "A":
    for i in range(1, len(s)):
        if s[i] == "C" and i != 1 and i != len(s) -1:
            if flg == 0:
                flg = 1
                k = i
            else:
                print("WA")
                exit()
    if k == 0:
        print("WA")
        exit()
    else:
        for j in range(1, len(s)):
            if s[j].isupper():
                if j != k:
                    print("WA")
                    exit()
            else:
                continue
else:
    print("WA")
    exit()
    
print("AC" if flg == 1 else "WA")

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

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

Solution (Python):
text = list(input())
check = 0
flag = False

def upper_count(string,c = 0):      
      for i in range(len(string)):
            if string[i].isupper() == True:
                  c += 1
      return c

if text[0] == "A":
      if "C" in text[2:len(text)-1]:
            flag = True



if flag == True and upper_count(text) == 2:
      print("AC")
else:
      print("WA")

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

Solution (Python):
s = input()
start_with_a = s[0] == 'A'
contains_c = s[2:-1].count('C') == 1
all_lowercases = s.replace('A', '').replace('C', '').islower()

print('AC' if all([start_with_a, contains_c, all_lowercases]) else 'WA')

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

Solution (Python):
s = input()
f = s[0]
ans = "AC"

if "C" in s[2:-1] and f == "A" and s[2:-1].count("C") == 1:
    pass
else:
    ans = "WA"

for i in s:
    if i.isupper():
        if i == "A" or i == "C":
            continue
        else:
            ans = "WA"

print(ans)

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

Solution (Python):

S = list(input())
judge = 0
if S[0].isupper() == True:
    judge += 1
if 'C' in S[2:-1] and S.count('C') == 1:
    judge += 1
if 'C' in S:
    S.remove('C')
if 'A' in S:
    S.remove('A')
if all(S[i].islower() for i in range(len(S))) == True:
    judge += 1
if judge == 3:
    print('AC')
else:
    print('WA')

Solution (Python):
s = str(input())
moji = ['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']
isOK = True
if s[0]=='A':
    tmp = s[2:-1]
    cnt = 0
    for i in range(len(tmp)):
        if tmp[i]=='C':
            cnt += 1
    if cnt!=1:
        isOK = False
else:
    isOK = False

cnt = 2
for i in range(len(s)):
    if s[i] in moji:
        cnt += 1
if len(s)!=cnt:
    isOK = False

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