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 sys
S = list(input())
N = len(S)
if S[0] == "A":
    s = 0
    for i in S[2:len(S)-1]:
        if i == "C":
            s += 1
    if s == 1:
        c = 0
        for i in S:
            if i.islower():
                 c += 1
        if c == N-2:
            print("AC")
            sys.exit()
print("WA")

Solution (Python):
S = input()

cnt = 0
if S[0] != 'A' or S[-1] == 'C' or S[1] == 'C':
    cnt += 1

A = S.replace('A', '')
A = A.replace('C', '')
if len(S) -2 != len(A) or A.islower() == False:
    cnt += 1
if cnt > 0:
    print('WA')
else:
    print('AC')

Solution (Python):
s = input()

a = s[0] == "A" and ("C" in s[2:-1]) and s[2:-1].count("C") == 1

s = list(s)
if "A" in s:
    s.remove("A")
else:
    print("WA")
    exit()
if "C" in s:
    s.remove("C")
else:
    print("WA")
    exit()

b = all(i.islower() for i in s)

if a and b:
    print("AC")
else:
    print("WA")

Solution (Python):
def is_target_string(S):
    if S[0] != 'A':
        return False
    C_cnt = 0
    C_index = -1
    for i in range(2, len(S)-1):
        if S[i] == 'C':
            C_cnt += 1
            C_index = i
    if C_cnt != 1:
        return False

    for i in range(len(S)):
        if i != 0 and i != C_index:
            if S[i].isupper():
                return False

    return True

S = input()

print('AC' if is_target_string(S) else 'WA')

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

Solution (Python):
s = input()
if s[0] == 'A':
    if s.count('C') == 1 and 2 <= s.find('C') <= len(s)-2:
        s_tmp = s[1:s.find('C')]+s[s.find('C')+1:]
        if s_tmp.islower() == True:
            print("AC")
            exit()

print("WA")

Solution (Python):
S = input()
cnt = 0
for i in range(len(S)):
  if i==0 and S[i]!="A":
    print("WA")
    exit()
  if 2<=i<=len(S)-2 and S[i]=="C":
    cnt+=1
    if cnt>1:
      print("WA")
      exit()
  if 1<=i<=len(S)-1:
    if S[i]!="C" and S[i].isupper():
      print("WA")
      exit()
if cnt<1:
  print("WA")
  exit()
print("AC")

Solution (Python):
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    import re
    pattern="^A[a-z]+C[a-z]+$"
    print("AC" if re.match(pattern,input()) else "WA")
resolve()

Solution (Python):
S = input().strip()
if S[0]=="A" and S[2:-1].count("C")==1:
    for i in range(2,len(S)-1):
        if S[i]=="C":
            ind = i
            break
    res = 0
    for i in range(1,len(S)):
        if i!=ind and not(97<=ord(S[i])<=122):
            res = 1
            break
    if res==0:
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
S = input()

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

print('WA')

Solution (Python):
S = input()
if S[0] == "A":
    flag = False
    for i, x in enumerate(S[2:-1]):
        if x == "C":
            if flag:
                flag = False
                break
            else:
                flag = True
                index = i+2
    if flag:

        if (len(S[1:index]) == 0 or S[1:index].islower()) and (len(S[index+1:]) == 0 or S[index+1:].islower()):
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
s = input()

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

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

if s[1:].replace("C", "").lower() == s[1:].replace("C", ""):
    print("AC")
else:
    print("WA")

Solution (Python):
s = input()

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

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

if s[1:].replace("C", "").lower() == s[1:].replace("C", ""):
    print("AC")
else:
    print("WA")

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

Solution (Python):
S = input()
if S.startswith('A') and S[2:-1].find('C') == S[2:-1].rfind('C') != -1 and S[1:].replace('C','') == S[1:].replace('C','').lower(): print('AC')
else: print('WA')

Solution (Python):
s=input()
c=0
l=['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':c+=1
if s[2:-1].count('C')==1:c+=1
x=0
for i in range(len(s)):
    x+=l.count(s[i])
if x==len(s)-2:c+=1
if c==3:
    print('AC')
else:
    print('WA')

Solution (Python):
import string

s = input()

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

l_case = string.ascii_lowercase
if s[2:-1].count('C') == 1:
    c_index = s[2:].index('C') + 2
    if all(map(lambda x: x in l_case, s[1:c_index] + s[c_index + 1:])):
        print("AC")
    else:
        print("WA")
else:
    print("WA")

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

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

Solution (Python):
x = [i for i in input()]
judge = 0
if x[0] == "A" :
  judge += 1
  if x[2:-1].count("C") == 1:
    judge += 1
    x.remove("A")
    x.remove("C")
    if "".join(x).islower():
      judge += 1
if judge == 3:
  print("AC")
else:
  print("WA")

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

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

if "C" not in s[2:-1]:
  print("WA");exit()
s_remove=s.remove
s_remove("A");s_remove("C")

s="".join(s)

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

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

Solution (Python):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')


S=input()

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

Solution (Python):
S = input()

cnt = 0

if S[0] != 'A':
    print('WA')
else:
    for i, s in enumerate(S[2:-1]):
        if s == 'C':
            cnt += 1
            c_idx = i
    if cnt == 1:
        c_idx += 2
        part_str = S[1:c_idx] + S[c_idx+1:]
        if part_str.islower():
            print('AC')
        else:
            print('WA')
    else:
        print('WA')

Solution (Python):
n = input()

if n[0] == 'A':
    for i in range(len(n)-3):
        
        if n[i+2] == 'C' and (n[1:i+2]+n[i+3::]).islower():
            print('AC')
            exit()

print('WA')

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

Solution (Python):

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

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

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

flag1=0
flag2=0
flag3=0

num_l=0
for i in range(N):
  if S[i].islower():
    num_l+=1

if num_l==N-2:
  flag1=1
  
if S[0]=="A":
  flag2=1

for i in range(2,N-1):
  if S[i]=="C":
    flag3=1


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

Solution (Python):
S = input()
if S[0] != 'A':
  print('WA')
  exit()
count = 0
if len(S) < 4:
  print('WA')
  exit()
for i in range(len(S) - 3):
  if S[i+2] == 'C':
    count += 1
  elif S[i+2].islower():
    continue
  else:
    print('WA')
    exit()
if S[1].isupper() or S[-1].isupper():
  print('WA')
  exit()
if count == 1:
  print('AC')
  exit()
print('WA')

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

Solution (Python):
S = input()

res = "AC"
if S[0] != "A" or S.count("C") != 1:
    res = "WA"

if "C" not in S[2:-1]:
    res = "WA"

if res == "AC":
    for s in S[1:]:
        if s != "C" and s != s.lower():
            res = "WA"
            break
print(res)

Solution (Python):
a = input()

if a[0]=='A' and 'C' in a[2:-1] and sum([i.isupper() for i in a])==2:
  print("AC")
  exit()
print("WA")

Solution (Python):
import re

S = input()
if re.search(r'^A[a-z][a-z]*C[a-z]*[a-z]$', S):
    print("AC")
else:
    print("WA")

Solution (Python):
s = list(input())
tru = 0
Ccount = 0
Lcount = 0
if s[0] != "A":
         tru = 1
for i in range(2,(len(s)-1)):
         if s[i] == "C":
                  Ccount += 1
if Ccount != 1:
         tru = 1
for j in range(len(s)):
         if s[j].isupper():
                  Lcount +=1
if Lcount != 2:
         tru = 1
if tru == 1:
         print("WA")
else:
         print("AC")

Solution (Python):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

s = input()[:-1]

if (s[0] != 'A' or s.count('C', 2, -1) != 1):
    print('WA')
    
    exit()
cPos = s.find('C', 2, -1)
if (s[1:cPos].islower() and s[cPos + 1:].islower()):
    
    print('AC')
    exit()
print('WA')

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

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

ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ"

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

c=0
idx=0
for i in range(2,N-1):
    if S[i]=="C":
        c+=1
        idx=i

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

for i in range(1,N):
    if not i ==idx:
        if S[i] in ABC:
            print("WA")
            exit()

print("AC")

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

Solution (Python):
import sys
def check_small(string):
    if string in 'abcdefghijklmnopqrstuvwxyz':
        return True
    else:
        return False

s = input()
if s[0] != 'A':
    print('WA')
    sys.exit()
if check_small(s[-1]) == False or check_small(s[1]) == False:
    print('WA')
    sys.exit()
count = 0
for si in s[2:]:
        if si == 'C':
            count += 1
        elif check_small(si) == False:
            print('WA')
            sys.exit()
print('AC' if count == 1 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()
n = len(s)
if s[0] == 'A' and s[2:n-1].count('C') == 1:
  s = s.replace('A','')
  s = s.replace('C','')
  if s == s.lower():
    print('AC')
    exit()
print('WA')

Solution (Python):
def valid(s):
    if s[0] != 'A':
        return False
    if s[2:-1].count('C') != 1:
        return False

    lowercase = sum(1 for ch in s if ch.islower())
    return lowercase == len(s) - 2


print("AC" if valid(input()) else "WA")

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

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

ok = s[0] == 'A' and s[2:-1].count('C') == 1
if ok:
    for i, c in enumerate(s):
        if i == 0:
            continue
        if 2 <= i < len(s) - 1 and c == 'C':
            continue
        if c != c.lower():
            ok = False

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

Solution (Python):

S = str(input())
count = 0
if S[0] == 'A':
    for i in range(2,len(S)-1):
        if S[i] == 'C':
            count += 1
        else:
            pass

    if count == 1:
        S_1 = set(S)
        S_1.remove('A')
        S_1.remove('C')
        if str(S_1).islower() :
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

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

Solution (Python):
s = input()
f1 = False
f2 = False
f3 = False
if s[0] == 'A':
    f1 = True
f2_index = None
for i in range(len(s)):
    if s[i] == 'C' and i >= 2 and i <= len(s) - 2:
        f2 = True
        f2_index = i
        break
for j in range(len(s)):
    if j != 0 and j != f2_index:
        if s[j].islower():
            f3 = True
        else:
            f3 = False
            break
if f1 and f2 and f3:
    print('AC')
else:
    print('WA')

Solution (Python):
s = input()

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

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

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

if s[0] == 'A':
    if 'C' in s[2:-1]:
        cidx = s.find('C')
        for i in range(1, len(s)):
            if i != cidx:
                if s[i].isupper():
                    print('WA')
                    sys.exit()
        print('AC')
        sys.exit()
    else:
        print('WA')
        sys.exit()
else:
    print('WA')
    sys.exit()

print('WA')

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

Solution (Python):
import sys
def input():
    return sys.stdin.readline()[:-1]
S = list(input())

if S[0]=='A':
    if S[2:-1].count('C')==1:
        for s in S[1:]:
            if s=='C':
                continue
            else:
                if not s.islower():
                    break
        else:
            print('AC')
            exit()
print('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=list(input())
count=0
for i in s:
    if i.isupper():
        count +=1
if count!=2:print("WA");exit()
else:
    if s[0]=="A":
        if s[2:-1].count("C")==1:
            print("AC")
        else:print("WA")
    else:print("WA")

Solution (Python):
n = list(str(input()))
a = n[2:]
b = a[:-1]
count = 0
cindex = []
for i in range(len(b)):
    if b[i] == "C":
        count += 1
        cindex.append(i)
if n[0] != "A" or count != 1:
    print("WA")
else:
    del n[0]
    del n[cindex[0] + 1]
    m = "".join(n)
    if m.islower():
        print("AC")
    else:
        print("WA")

Solution (Python):
S = list(input())
l = len(S)
if S[0]=="A" and "C" in S[2:l-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()
f = False
n = len(S)

f = True
ff = False

if S[0] != "A":
  f = False
if S[1].isupper():
  f = False
for i in range(2,n-1):
  if S[i] == "C" and ff == False:
    ff = True
  elif S[i].isupper():
    f = False
if S[-1].isupper():
  f = False

if f == False or ff == False:
  print("WA")
else:
  print("AC")

Solution (Python):
import sys
s = list(input())
if s[0] == 'A':
  del s[0]
  if s[1:-1].count('C') == 1:
      s.remove('C')
      for i in range(len(s)):
          if s[i].isupper():
              print('WA')
              sys.exit()
      print('AC')
  else:
      print('WA')
else:
    print('WA')

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

Solution (Python):
import collections
s=input()
c = collections.Counter(s[2:-1])
if s[0]=="A" and c["C"] == 1:
    for item in s:
        if item.isupper() == True and item!="A" and item!="C":
            print("WA")
            exit()
    print("AC")
else:
    print("WA")

Solution (Python):
s = input()
if s[0]=='A' and s[2:-1].count('C')==1 and s.translate(str.maketrans({'A':'', 'C':''})).islower():
    print('AC')
else:
    print('WA')

Solution (Python):
S = list(input())
ans ="AC"
if S[0]!="A":
    ans ="WA"
if S.count("C") !=1:
    ans ="WA"
if S[2:-1].count("C")!=1:
    ans ="WA"
if S[0]==("A"):
    del S[0]
if S.count("C")>0:
    S.remove("C")
S = str(S)
for i in range(len(S)):
    if (S[i]).isupper():
        ans = "WA"
print(ans)

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

count2 = 0
for i in S:
    if i == i.upper():
        count2 += 1
if count2 != 2:
    flag = 1
    
if flag == 0:
    print("AC")
else:
    print("WA")

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

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

if count == 3:
    print("AC")
else:
    print('WA')

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

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

Solution (Python):
S = input()
if S[0] == 'A' and S[2:-1].count('C') == 1 and S[1].islower() and S[2:].replace('C', 'c').islower():
    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()

i = S[2:-1].find('C')

if i >= 0:
    S = S[1:2 + i] + S[2 + i + 1:]
    if S.islower():
        print('AC')
        exit()
    else:
        print('WA')
        exit()
else:
    print('WA')

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

Solution (Python):
S = input()

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

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

for i in range(1,len(S)):
    if i == index:
        pass
    elif S[i].islower() != True:
        print("WA")
        exit()

print("AC")

Solution (Python):

import sys


def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

S = IS()
if S[0] == "A" and S.count("C") == 1 and S[-1] != "C":
    if S[1].islower() == True:
        if S[S.index("C")+1:].islower() == True:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("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()
flag = 0
cnt = 0
for i in range(ord("A"),ord("Z")+1):
    cnt += s.count(chr(i))

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

Solution (Python):
s = input()

import re

a = s[0] == "A"
b = len(re.findall("C", s[2:-1])) == 1
c = len(re.findall(r"[a-z]", s)) == len(s) - 2

if a and b and c:
    print("AC")
else:
    print("WA")

Solution (Python):
S=input()
ans=True
if S[0]!="A":
  ans=False

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

if (S.replace("A","a").replace("C","c"))!=S.lower():
  ans=False

print(("WA","AC")[ans])

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

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

Solution (Python):
S = input()
if S[0] == "A" and not(S.find("C", 2, -1) < 0) and S[1:S.find("C", 2, -1)].islower() and S[S.find("C", 2, -1)+1:].islower():
  print("AC")
else:
  print("WA")

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

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

if sum(1 for c in S if c.isupper()) != 2:
  ans = 'WA'
print(ans)

Solution (Python):

S = input()

c1 = False
c2 = False
c3 = False

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

if S.count("C",2,-1) == 1:
    c2 = True

S = S.replace("A","").replace("C","")

if S.islower():
    c3 = True

if c1 == True and c2 == True and c3 == True:
    print("AC")
else:
    print("WA")

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

Solution (Python):
s = input()

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

Solution (Python):
s = input()

if s[0] != "A":
  print("WA")
  exit()
  
if "C" not in s[2:-1]:
  print("WA")
  exit()
else:
  l = list(s[2:-1])
  l.remove("C")
  if "C" in l:
    print("WA")
    exit()

lst = list(s)
lst.remove("A")
lst.remove("C")
a = "".join(lst)

if a == a.lower():
  print("AC")
else:
  print("WA")

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

Flag = False
if S[0] == "A" and S[2:-1].count("C") == 1:
    S.remove("A")
    S.remove("C")
    string = "".join(S)
    if string.islower() or string.isupper():
        Flag = True

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

Solution (Python):
s=str(input())
if s[0]!='A':
    print('WA')
else:
    c=s.count('C',2,len(s)-1)
    if c!=1:
        print('WA')
    else:
       d=s.find('C',2,len(s)-1)
       s=s[1:d]+s[d+1:]
       ss=s.lower()
       
       print('AC' if s==ss else 'WA')

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

Solution (Python):
s = input()
cnt = 0
for x in s:
    if x.isupper():
        cnt += 1

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

Solution (Python):
s = input()

ok = True
if s[0] != "A" or s[-1] == "C" or s[1] == "C":
    ok = False
count = 0
for i in range(1, len(s)):
    if s[i] == "C" and i != len(s)-1:
        count += 1
    elif s[i] not in "abcdefghijklmnopqrstuvwxyz":
        ok = False
        break
if count != 1:
    ok = False

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

Solution (Python):
s = input()
flag = True
if s[0]!='A': flag=False
if s[2:-1].count('C')!=1: flag=False
if flag:
    l = list(s[2:-1])
    l.remove('C')
    s = s[1] + ''.join(l) + s[-1]
    if s!=s.lower(): flag=False
print("AC" if flag else "WA")

Solution (Python):
import sys

stdin = sys.stdin

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

alpha2num = lambda c: ord(c) - ord('a') + 1

s = input()
ans = "WA"
if s[0] == "A" and s.count("C") == 1:
    if 2 <= s.index("C") <= len(s) - 2:
        for i in range(1, len(s)):
            if i == s.index("C"):
                continue
            elif 1 <= alpha2num(s[i]) <= 26:
                ans = "AC"
            else:
                ans = "WA"
                break
print(ans)

Solution (Python):
import sys

s = input()
if s[0] == 'A':
    if 'C' in s[2:-1]:
        index = s[2:-1].index('C') + 2
        news = s[1:index] + s[index+1:]
        if news == news.lower():
            print('AC')
            sys.exit()
print("WA")

Solution (Python):
import re

def check1(s):
    if s[0] == "A":
        return 1
    else:
        return 0

def check2(s):
	temp = s.lstrip(s[0]+s[1]).rstrip(s[-1]) 
	if temp.count("C") == 1:
		return 1
	else:
		return 0

def check3(s):
	if re.sub("[AC]","",s).islower() == True:
		return 1
	else:
		return 0

s = str(input())

if check1(s) + check2(s) + check3(s) == 3:
	print("AC")
else:
	print("WA")

Solution (Python):
S = input()

flag = True
if S[0] != "A":flag = False
if S[2:-1].count("C") != 1:flag = False
if flag:
    ind = S[2:-1].index("C") + 2
    print("AC") if (S[1:ind] + S[ind+1:]).islower() else print("WA")
else:
    print("WA")

Solution (Python):


S = input()

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

print('WA')

Solution (Python):
s=input()

num=0
if s[0]=='A':
  if 'C' in s[2:-1]:
    tmp=s[1:].replace('C','c',1)
    if tmp.islower():
      print('AC')
    else:
      print('WA')
  else:
    print('WA')
else:
  print('WA')

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

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

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

Solution (Python):
s = input()
ans ='AC'
if s[0]!='A':
  ans = 'WA'

if s[2:-1].count('C')!=1 or s.count('C')>=2:
  ans = 'WA'
  
nc = []  
for c in s[1:]:
  if c!= 'C':
    nc.append(c)
if not ''.join(nc).islower():
  ans = 'WA'

print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(200000)
input = sys.stdin.readline

S = input().strip()

f = True

c = 0
for i in range(len(S)):
    if i == 0:
        if S[i] != "A":
            f = False
            break
        continue

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

    if S[i].lower() != S[i]:
        f = False
        break

if f and c == 1:
    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()

if (S[1:S.find("C")] + S[S.find("C")+1:]).islower() == False:
    print("WA")
    exit()

print("AC")

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

Solution (Python):
s = input()

if s[0] == 'A' and s[2:-1].count('C') == 1:
  for letter in s[1:]:
    if letter != letter.lower() and letter != 'C':
      print('WA')
      break
  else:
    print('AC')
else:
  print('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()
a = S[0] == "A"
f = 0
for _ in S[2:len(S)-1]:
    if _ == "C":
        f+=1
if f == 1:
    b = True
else:
    b = False

if S.replace("A", "").replace("C","").islower():
    c = True
else:
    c = False

if a and b and c:
    print("AC")
else:
    print("WA")

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

Solution (Python):
s=list(input())
n=len(s)
ans="AC"
if(s[0]!="A"):
    ans="WA"
else:
    s[0]=s[0].swapcase()
cnt=0
check=0
for i in range(n-3):
    if(s[i+2]=="C"):
        check+=1
        s[i+2]=s[i+2].swapcase()
if(check!=1):
    ans="WA"
if(str.islower(''.join(s))==False):
    ans="WA"
print(ans)

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

Solution (Python):
def test():
    s = input()
    a = []
    count = 0
    if s[0] == "A":
        for i in range(2,len(s)-1):
            if s[i] == "C":
                a.append(i)
                count += 1

    s2 = list(s)
    for i in a:
        s2.remove(s[i])

    s3 = "".join(s2[1:])

    if count == 1 and s3.islower():
        print("AC")
    else:
        print("WA")


if __name__ == "__main__":
    test()

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

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

Solution (Python):
import math
import sys
import queue
from collections import Counter
from itertools import accumulate
from fractions import gcd
from functools import reduce

def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

mod = 1000000007

"""


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


    = int(sys.stdin.readline())
    = map(int, sys.stdin.readline().split())
    = list(map(int, sys.stdin.readline().split()))
    = [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

if __name__ == "__main__":
    S = list(sys.stdin.readline().rstrip())
    if S[0] == "A":
        if "C" in S[2:len(S) - 1:]:
            S.remove("A")
            S.remove("C")
            if "".join(S).islower():
                print("AC")
                exit()
    print("WA")

Solution (Python):
def main():
    S = input()
    n = len(S)
    if S[0] != "A": return "WA"

    j = None
    for i in range(2, n-1):
        if S[i] == "C":
            if j == None:
                j = i
            else:
                return "WA"
    if j == None: return "WA"
    for i in range(1, n):
        if i != j and not S[i].islower():
            return "WA"
    return "AC"



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

Solution (Python):
S = input()
ans = 'WA'
if S[0] == 'A':
    if S[2:-1].count('C') == 1:
        tmp = 0
        for c in S:
            if c.islower(): tmp += 1
        if tmp == len(S) - 2:
            ans = 'AC'
print(ans)