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):
moji=str(input())
lst=["A", "B", "D", "E", "F", "G", "H", "I", "J", "K"< "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
cnt = 0
temp = 0
for i in range(len(moji)):
  if i==0:
    if moji[i]=="A":
      continue;
    else:
      cnt+=1
      break;
  if 2<=i<=len(moji)-2:
    if moji[i] in lst:
      cnt +=1
      break;
    elif moji[i] == "C":
      temp += 1
      lst.append("C")
      continue;
  if i==1 or i==len(moji)-1:
    if moji[i] in lst or moji[i] == "C":
      cnt+=1
if cnt==0 and temp == 1:
  print("AC")
else:
  print("WA")

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7


alphala=[chr(i) for i in range(65, 65+26)]


s=input().rstrip()
count=0

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

y=0
for i in range(len(s)):
    k=s[i]
    if k in alphala:
        y+=1
    
if y==2:
    count+=1

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

Solution (Python):
S = input()
chk1 = 0
chk2 = 0
chk3 = 0
chk4 = 0
if S[0] == 'A':
    for i in range(1, len(S), 1):
        ord_c = ord(S[i])
        
        if i == 1 and (65 <= ord(S[i]) and ord(S[i]) <= 90):
            chk1 = 1

        
        if i == len(S)-1 and (65 <= ord(S[i]) and ord(S[i]) <= 90):
            chk2 = 1
        
        elif ord_c == 67:
            chk3 += 1

        
        elif 65 <= ord_c and ord_c <= 90:
            chk4 = 1

    if chk3 == 1 and chk1 == 0 and chk2 == 0 and chk4 == 0:
        print('AC')
    else:
        print('WA')
else:
    print('WA')

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

Solution (Python):


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

Solution (Python):
S="abcdefghijklmnopqrstuvwxyz"
s=input()
n=len(s)
flag=0
if s[0]!="A":
    flag=1
cut=s[2:n-1]
if cut.count("C")!=1:
    flag=1
else:
    cut=s[1:]
    for c in cut:
        if ((not c in S) and c!="C"):
            flag=1
            break

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

Solution (Python):
s=input()
lenlen=len(s)
count=0
if s[0]=="A":
  t=s[2:lenlen-1]
  for i in range(0,len(t)):
    if t[i]=="C":
      count+=1
  if count==1:
    tttt=0
    for j in range(0,lenlen):
      if not 97<=ord(s[j])<=122:
        tttt+=1
    if tttt==2:
      print("AC")
    else:
      print("WA")
  else:
    print("WA")
else:
  print("WA")

Solution (Python):
S = input()

jdg = True
cnt = 0

for i, s in enumerate(S):
    if i == 0 and s != 'A':
        jdg = False
        break
    if (i == 1 or i == len(S) - 1) and not s in 'abcdefghijklmnopqrstuvwxyz':
        jdg = False
        break
    if 2 <= i <= len(S) - 2 and s == 'C':
        cnt += 1
    if i >= 1 and not s in 'abcdefghijklmnopqrstuvwxyzC':
        jdg = False
        break
if cnt != 1: jdg = False
            
print('AC' if jdg else 'WA')

Solution (Python):
s = input()
ans = 'AC'
ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(s)):
    if i == 0:
        if s[i] != 'A':
            ans = 'WA'
    if i == 1 or i == len(s)-1:
        if s[i] not in ascii_lowercase:
            ans = 'WA'
if s[2:-1].count('C') != 1:
    ans = 'WA'
print(ans)

Solution (Python):
s = input()
if s[0]!='A' or s[2:-1].count('C')!= 1:
  print('WA')
  exit()
  
for c in s[1:]:
  if not(('a'<= c <= 'z') or  c=='C'):
    print('WA')
    break
else:
  print('AC')

Solution (Python):

s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1:
    t = s.replace('A', '')
    t = t.replace('C', '')
    for i in t:
        if ord('a') <= ord(i) <= ord('z'):
            continue
        else:
            print('WA')
            break
    else:
        print('AC')
else:
    print('WA')

Solution (Python):
import sys

input = sys.stdin.readline
MOD = 1000000007

S = input()[:-1]

S = list(S)

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

print("WA")

Solution (Python):
import sys

input = sys.stdin.readline
MOD = 1000000007

S = input()[:-1]

S = list(S)

if S[0] == 'A':
    if 'C' in S[2:-1] and  S.count('C') == 1:
        x = []
        for i in range(1,len(S)):
            if S[i] == 'C':
                continue
            x.append(S[i])
        
        
        if str(x).islower():
            print("AC")
            exit()

print("WA")

Solution (Python):


s=list(input())
n=len(s)

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

if s[0]=='A' and cnt==1:
    s.pop(0)
    s.remove('C')
    for c in s:
        if c.islower()==False:
            print("WA")
            break
    else:
        print("AC")
else:
    print("WA")

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

ll = len(s)

ans = 'AC'

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

cnt = 0

for i in range(1, len(s)):
    if s[i].isupper():
        if i == 1 or i == ll - 1 or s[i] != 'C':
            ans = 'WA'
        cnt += 1

if cnt != 1:
    ans = 'WA'

print(ans)

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

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

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

Solution (Python):
def sol():
    S = input()

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

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

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

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

    print('AC')

sol()

Solution (Python):
s = input()
if s[0] != "A":
    ans = "WA"
elif ord(s[1]) < 91:
    ans = "WA"
elif ord(s[-1]) < 91:
    ans = "WA"
else:
    ans = "AC"
    c = 0
    for i in range(2, len(s) - 1):
        if s[i] == "C":
            c += 1
        elif ord(s[i]) < 91:
            ans = "WA"
            break
    if c != 1:
        ans = "WA"

print(ans)

Solution (Python):
S=input()
if S[0]!="A":
    print("WA")
    exit()
else:
    if S[2:-1].count("C")!=1:
        print("WA")
        exit()
    else:
        x=S.index("C")
        for i in range(len(S)):
            if i==0 or i==x:
                pass
            else:
                if 65<=ord(S[i])<=90:
                    print("WA")
                    exit()
print("AC")

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

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

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

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

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

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

    s = s[1:]
    s = s.replace('C','')

    if not s.islower():
        print('WA')
        exit()  

    print('AC')

if __name__ == '__main__':
    main()

Solution (Python):
s = input()
ok = True

ok &= s[0] == 'A'
ok &= s[2:-1].count('C') == 1
ok &= s[1:].replace('C', '').islower()

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

Solution (Python):
s = input()
count1 = 0
count2 = 0
if s[0] == 'A'and s[1].islower() == True and s[len(s)-1].islower() == True:
    count1 += 1
for i in range(2, len(s) - 1):
    if s[i] == 'C':
        count2 += 1
    elif s[i].islower == False:
        print('WA')
        break
if count1 != 1 or count2 != 1:
    print('WA')
else:
    print('AC')

Solution (Python):
s = input()
ok = True

ok &= s[0] == 'A'
ok &= s[1].islower()
ok &= s[2:-1].count('C') == 1
ok &= all(c.islower() for c in s[2:-1] if c != 'C')
ok &= s[-1].islower()

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

Solution (Python):
s = input()
count1 = 0
count2 = 0
count3 = 0
count4 = 0
if s[0] == 'A'and s[1].islower() == True and s[len(s)-1].islower() == True:
    count1 += 1
for i in range(2, len(s) - 1):
    if (s[i] == 'C'):
        count2 += 1
if count1 != 1 or count2 != 1:
    print('WA')
else:
    print('AC')

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

Solution (Python):


s = input()

ans = "AC"
cnt = 0

if s[0] != "A":
    ans = "WA"

for i in range(1, len(s)):
    t = s[i]
    if t == "C":
        if 2 <= i < len(s) - 1:
            cnt += 1
    else:
        if t.isupper():
            ans = "WA"

if cnt != 1:
    ans = "WA"

print(ans)

Solution (Python):
s = input()
small = [chr(i+97) for i in range(26)]
count = 0
for i in range(len(s)):
    if i == 0:
        if s[i] == 'A':
            continue
        else:
            print("WA")
            break
    elif i == 1:
        if not s[i] in small: 
            print("WA")
            break
    elif i == len(s)-1:
        if not s[i] in small:
            print("WA")
            break
    else:
        if s[i] == 'C':
            count += 1
        elif not s[i] in small:
            print("WA")
            break
else:
    if count == 1:
        print("AC")
    else:
        print("WA")

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

Solution (Python):
S = input()
ans = 'AC'
if S[0] != 'A':
    ans = 'WA'
cnt = 0
for i in range(1,len(S)):
    if S[i].isupper():
        if i == 1 or i == len(S)-1 or S[i] != 'C':
            ans = 'WA'
        cnt+=1

if cnt != 1:
    ans = 'WA'
print(ans)

Solution (Python):
S = input()
ans = True
count = 0
for i in range(len(S)):
    if i == 0 and S[0]!='A':
        ans = False
        break
    if 2 <= i <= len(S)-2:
        if S[i] == 'C':
            count += 1
            if count > 1:
                ans = False
                break
        elif ord(S[i])-ord('a') < 0 or ord(S[i])-ord('a') > 25:
            ans = False
            break
    if (i == 1 or i == len(S)-1) and ord(S[i])-ord('a') < 0 or ord(S[i])-ord('a') > 25:
        ans = False
        break
if ans and count==1:
    print('AC')
else:
    print('WA')

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

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

tmp = 0
for s in S:
    if ord('a') <= ord(s) <= ord('z'):
        tmp += 1


if tmp != (len(S) - 2):
    ans = 'WA'

print(ans)

Solution (Python):
s = input()
ans = True
if s[0]!='A':
    ans = False
if s[2:-1].count('C')!=1:
    ans = False
upper = 0
for i in  s:
    if i.isupper():
        upper += 1

if upper != 2:
    ans = False

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

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

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

ans = 'AC'


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


C_cnt=0
for s in S[2:-1]:
    if s=='C':
        C_cnt+=1
    
if C_cnt != 1:
    ans = 'WA'
    

Up_cnt=0
for s in S:
    if s.isupper()==True:
        Up_cnt+=1
if Up_cnt != 2:
    ans = 'WA'
    
print(ans)

Solution (Python):
def judge(string):
    s_li = [x for x in string]
    if "A" in s_li:
        s_li.remove("A")

    if "C" in s_li:
        s_li.remove("C")

    return string[0] == "A" and string[2:-1].count("C") == 1 and str(s_li).islower()


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

Solution (Python):
import sys
s= input()
n =len(s)
Al = [chr(_)  for _ in range(97,124)]
if s[0] == "A" and s[2:n-1:1].count("C")==1:
    for i in range(1,n):
        if not(s[i] in Al or s[i]=="C"):
            print('WA')
            sys.exit()
    print('AC')
    sys.exit()
else:
    print('WA')

Solution (Python):
s = input()
out = False
if s[0] != 'A':
    out = True
C = False

if s[1].isupper():
    out = True

for ss in s[2:-1]:
    if ss == 'C':
        if C:
            out = True
        C = True
    elif s.isupper():
        out = True

if not C or s[-1].isupper():
    out = True

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

Solution (Python):
s = input()

ac = s[0] == 'A'
ac &= s[2:-1].count('C') == 1
ac &= s.replace('A', '').replace('C', '').islower()

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

Solution (Python):
s=input()
a=True
if s[0]!='A':

    a=False

s2=s[2:-1]
if s2.count('C')!=1:


    a=False

s3=s.replace('C','c',1)
s3=s3.replace('A','a',1)
if s3.islower()==False:

    a=False

if a==True:
    print('AC')
else:
    print('WA')

Solution (Python):
s = input()

flag = True

if s[0] != 'A' or s.count('C') != 1 or s[2:-1].count('C') != 1:
    flag = False
else:
    for i in range(1, len(s)):
        if s[i] != 'C' and s[i].isupper():
            flag = False

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

Solution (Python):
s = input()

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

Solution (Python):
s = input()
l = len(s)

if s[0] == "A":
    if s[2:l - 1].count("C") == 1:
        if s.count("A") == 1:
            if s.count("C") == 1:
                s = s.replace("A", "a")
                s = s.replace("C", "c")
                if s.islower() == True:
                    print("AC")
                    exit()
print("WA")

Solution (Python):
s = input()
x = s[0]
ans = 0
if x == "A":
    y = s[2:len(s)-1]
    z = y.count("C")
    if z == 1:
        a = y.replace("C","")
        word = s[1] + a + s[len(s)-1]
        if word.islower():
            ans += 1
if ans == 1:
    print("AC")
else:
    print("WA")

Solution (Python):
s = input()
count = 0
flag = True
for i in range(len(s)):
    if i==0:
        if s[0]!="A":
            flag = False
    else:
        if 2<=i<=len(s)-2:
            if s[i]=='C':
                if count>0:
                    flag = False
                else:
                    count += 1
            else:
                if 97>ord(s[i]) or ord(s[i])>122:
                    flag = False
        else:
            if 97>ord(s[i]) or ord(s[i])>122:
                flag = False
if count==0:
    flag = False
print('AC' if flag==True else 'WA')

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

if __name__ == '__main__':
    main()

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

Solution (Python):
import sys
from collections import Counter
readline = sys.stdin.buffer.readline
MOD = 10**9+7
INF = float('inf')

def main():
    S = list(readline().rstrip().decode('utf-8'))

    bl = S[0] == 'A'
    bl &= ('C' in S[2:-1])

    if bl:
        S.remove('A');
        S.remove('C')

    bl &= all('a' <= x <= 'z' for x in S)

    answer = 'AC' if bl else 'WA'
    print(answer)




if __name__ == '__main__':
    main()

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

Solution (Python):
num = list(input())
count_c = num[2:-1].count("C")

if num[0] != "A":
  print("WA")
else:
  if count_c > 1:
    print("WA")
  else:
    if count_c == 1:
      num.remove("C")
      num.remove("A")
      jadge = "".join(num)
      if jadge:
        suuzi = "false"
        for i in range(len(num)):
          if num[i].isdecimal():
            suuzi = "true"
            break
          elif num[i].isupper():
            suuzi = "true"
            break
        if(suuzi == "false"):
          print("AC")
        else:
          print("WA")
      else:
        print("WA")
    else:
      print("WA")

Solution (Python):
s = input()
n = len(s)
for i in range(1, n):
    if ord(s[i]) < 97 and s[i] != "C":
        print("WA")
        exit()
cnt_c = 0
for i in range(2, n - 1):
    if s[i] == "C":
        cnt_c += 1
if cnt_c != 1:
    print("WA")
    exit()
print("AC" if s[0] == "A" else "WA")

Solution (Python):
s = input()
if s[0] != 'A': print('WA')
else:
    c_cnt = 0
    end_p = len(s)-2
    for i in range(1,len(s)):
        
        
        if 2 <= i <= end_p and s[i] == 'C':
            c_cnt += 1
        
        
        elif s[i] != s[i].lower():
            print('WA')
            exit()

    if c_cnt != 1:
        print('WA')
    else:
        print('AC')

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

    s = input().rstrip()
    alphabet = 'abcdefghijklmnopqrstuvwxyz' 
    if s[0] == 'A':
        cnt = 0
        for i in range(len(s)):
            if 2<=i<=len(s)-2:
                if s[i] == 'C':
                    cnt += 1
                    k = i
        if cnt == 1:
            for i in range(len(s)):
                if i==0 or i==k:
                    continue
                else:
                    if s[i] not in alphabet:
                        break
            else:
                print('AC')
                exit()
    print('WA')

if __name__ == '__main__':
    main()

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

Solution (Python):
s = input()
cnt = 0
if s[0] == "A" and s[2:-1].count("C") == 1:
    for i in range(len(s)):
        if ord(s[i])<=90:
            cnt += 1
    if cnt != 2:
        print("WA")
        quit()
    else:
        print("AC")
else:
    print("WA")

Solution (Python):
s = input()

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

Solution (Python):
def main():
    S = input()
    L, R = 2, len(S) - 2
    if S[0] != 'A':
        print('WA')
        exit()

    cnt = 0
    for i in range(1, len(S)):
        if S[i] == 'C' and L <= i <= R:
            cnt += 1
            continue
        if S[i].isupper():
            print('WA')
            exit()

    if cnt != 1:
        print('WA')
    else:
        print('AC')


if __name__ == '__main__':
    main()

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

if cnt!=2:
    print('WA')
else:
    print('AC')

Solution (Python):
S = input()

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

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

if not S.islower():
  flag=0
     
print('AC' if flag==1 else 'WA')

Solution (Python):
S = list(input())
L = S[2:len(S)-1]
a = 0
for i in range(len(S)):
    if 65 < (ord(S[i])) <= 90:
        a = a+1

if L.count("C") == 1 and S[0] == "A" and a == 1:
    print("AC")
else:
    print("WA")

Solution (Python):
S=str(input())
letter="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
condition1 = S[0]=='A'
condition2 = len([1 for x in S[2:len(S)-1] if x=="C"]) == 1
count=0
for i in range(len(S)):
  if len([1 for x in letter if x==S[i]]) == 1:
    count = count + 1
condition3 = count == 2
if condition1 & condition2 & condition3:
  print('AC')
else:
  print('WA')

Solution (Python):


from collections import deque,Counter













S = input()

def check(S):
    if S[0]!="A":
        return False
    if Counter(S[2:-1])["C"]!=1:
        return False
    s_counter = Counter(S)
    for w in s_counter:
        if w.isupper():
            if w == "A":
                if s_counter[w] != 1:
                    return False
            elif w == "C":
                if s_counter[w] != 1:
                    return False
            else:
                return False
    return True

if check(S):
    print("AC")
else:
    print("WA")

Solution (Python):
s=input()
l=len(s)

ans='AC'
c=0
cp=0
if s[0]!='A':
  ans='WA'
for i in range(2, l-1):
  if s[i]=='C':
    c+=1
    cp=i
if c!=1:
  ans='WA'
ls = s[1:cp] + s[cp+1:l]

if not ls.islower():
  ans='WA'
print(ans)

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

Solution (Python):
s = input()
b = "abcdefghijklmnopqrstuvwxyz"

if s[0] != "A":
	print ("WA")
	exit()
if s[1] not in list(b) or s[-1] not in list(b):
	print ("WA")
	exit()
flg = 0
for i in range(2,len(s)-1):
	if s[i] == "C":
		if flg == 1:
			print ("WA")
			exit()
		flg = 1
	else:
		if s[i] not in list(b):
			print ("WA")
			exit()
if flg == 0:
	print ("WA")
else:
	print ("AC")

Solution (Python):
S = input()

cap = S[0]
mid = list(S[2:-1])

if (mid.count('C') >= 1):
    index = S.index('C')
    strr = S[1:index] + S[index + 1 :]
else:
    print('WA')
    exit()


if (cap == 'A' and mid.count('C') == 1 and strr.islower() == True):
    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()

for i in S[1:].split('C'):
    if not i.islower():
        print('WA')
        exit()

print('AC')

Solution (Python):
S = input()

ans = 'AC'

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

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

X = S[1:].split('C')
for x in X:
    if x.islower():
        pass
    else:
        print('WA')
        exit()

print(ans)

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

Solution (Python):
s=input()

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

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

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

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

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

if S[0] != "A":
    print("WA")
    sys.exit()
if S[1].isupper() or S[-1].isupper():
    print("WA")
    sys.exit()
T = S[2:len(S)-1]
if list(T).count("C") == 0 or list(T).count("C") > 1:
    print("WA")
    sys.exit()
for i in range(len(T)):
    if T[i].isupper() and T[i] != "C":
        print("WA")
        sys.exit()
print("AC")

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

flag = True
if s[0] != "A" or (not "C" in s[2:-1]):
  flag = False
  
else:
  cin = s.index("C")
  for i in range(len(s)):
    if i == 0 or i == cin:
      continue

    if (not s[i] in alpha):
      flag = False
      break
    
print("AC" if flag else "WA")

Solution (Python):
S = list(input())
if S[0]=="A":
    s = S[2:-1]
    C_count = s.count("C")
    if C_count==1:
        C_index = s.index("C")
        del S[0] 
        del S[C_index+1]
        if "".join(S).islower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,operator,string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
def LS(): return list(input().split())

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

Solution (Python):
S = input()

if S[0] != 'A':
    print('WA')
    exit()
    
index = S[2:-1].find('C')
if index == -1:
    print('WA')
    exit()
index = S[2:-1].find('C',index+1)
if index >= 0:
    print('WA')
    exit()


index = S.find('C')
S=S[1:index] + S[index + 1:len(S)]

if S != S.lower():
    print('WA')
    exit()

print('AC')

Solution (Python):
icase=104
if icase==104:
    s=input()
    yn=""
    if s[0]!="A":
        yn="WA"
    elif not s[1].islower():
        yn="WA"
    else:
        icnt=0
        for i in range(2,len(s)-1):
            if s[i]=="C":
                icnt+=1
            elif not s[i].islower():
                yn="WA"
                break
        if icnt!=1:
            yn="WA"                
        if not s[-1].islower():
            yn="WA"
    if yn=="WA":
        print("WA")
    else:
        print("AC")

Solution (Python):

S = input()
upper_cnt=0
for i,c in enumerate(S):
    if (i==0 and c!="A") or S[2:-1].count("C")!=1 or (i==1 and not c.islower()):
        print('WA')
        exit()
    if i>=1 and c.isupper():
         upper_cnt+=1
    if upper_cnt >1:
        print('WA')
        exit()
print('AC')

Solution (Python):
s = input()
flag = True
ko = ["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':
    pass
else:
    flag = False
cnt = 0
for i in range(2, len(s)-1):
    if s[i] == 'C':
        cnt += 1
        id = i
if cnt == 1:
    pass
else:
    flag = False
if flag:
    for i in range(1, len(s)):
        if id != i:
            if s[i] not in ko:
                flag = False
if flag:
    print("AC")
else:
    print("WA")

Solution (Python):
s = input()
t = s[2:-1]
i = s.find('C')
u = s[1:i] + s[i+1:]
if s[0]!='A' or 'C' not in t or t.count('C')!=1 or not u.islower():
    print('WA')
else:
    print('AC')

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

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


if 'C'not in S[2:-1]:ans='WA'

count=0
for i in S:
    if 65<=ord(i)<=90:
        count+=1
if count!=2:ans='WA'

print(ans)

Solution (Python):

import io

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

Solution (Python):
def main():
    S = list(input())
    res = True
    if S[0] != "A" :
       res = False 
    count = S[2:len(S)-1].count("C")
    if count > 1 or count == 0:
        res = False
    else:
        S.remove("C")
    S.pop(0)
    for i in range(len(S)):
        if str(S[i]).isupper() :
            res = False
    if res :
        print("AC")
    else:
        print("WA")
main()

Solution (Python):
import re
if re.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):
    pos=S.index("C")
    check=S[1:pos]+S[pos+1:]
    if check.islower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Solution (Python):
s = input()
ans = 1
if s[0] != 'A':
    ans = 0
if not 'C' in s[2:-1]:
    ans = 0
cnt = 0
for i in s:
    if i in [chr(i) for i in range(65, 65+26)]:
        cnt += 1
if cnt != 2:
    ans = 0
if ans == 1:
    print('AC')
else:
    print('WA')

Solution (Python):
S = input()
flag = 1
if S[0] != 'A':
    flag = 0
if not 'C' in S[2:-1]:
    flag = 0
cnt = 0
for i in S:
    if i in [chr(i) for i in range(65, 65+26)]:
        cnt += 1
if cnt != 2:
    flag = 0
if flag:
    print('AC')
else:
    print('WA')

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

Solution (Python):
s=input()

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

Solution (Python):
from string import ascii_lowercase

s = list(input())
ans = 'AC'

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

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

if not s[1] in ascii_lowercase:
    ans = 'WA'

if not s[-1] in ascii_lowercase:
    ans = 'WA'

for c in s[2:-1]:
    if c == 'C':
        continue
    if not c in ascii_lowercase:
        ans = 'WA'
        
print(ans)

Solution (Python):

def myAnswer(S:list)->str:
   if(S.pop(0) !="A"): return "WA"
   flag = False
   for n,s in enumerate(S):
      if(n>=1 and n <= len(S)-2 and flag==False and s=="C"):
         flag = True
      else:
         if(s.isupper()):
            return "WA"
   return "WA" if(flag==False) else "AC"


def modelAnswer():
   tmp=1
def main():
   S = list(input())
   print(myAnswer(S))
if __name__ == '__main__':
   main()