Problem:
 Score : 200 points    Problem Statement You are given a string S . Each character of S is uppercase or lowercase English letter.
Determine if S satisfies all of the following conditions:   The initial character of S is an uppercase A .  There is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).  All letters except the A and C mentioned above are lowercase.       Constraints  4 ≤ |S| ≤ 10 ( |S| is the length of the string S .)  Each character of S is uppercase or lowercase English letter.         Input Input is given from Standard Input in the following format:  S       Output If S satisfies all of the conditions in the problem statement, print AC ; otherwise, print WA .        Sample Input 1 AtCoder      Sample Output 1 AC  The first letter is A , the third letter is C and the remaining letters are all lowercase, so all the conditions are satisfied.       Sample Input 2 ACoder      Sample Output 2 WA  The second letter should not be C .       Sample Input 3 AcycliC      Sample Output 3 WA  The last letter should not be C , either.       Sample Input 4 AtCoCo      Sample Output 4 WA  There should not be two or more occurrences of C .       Sample Input 5 Atcoder      Sample Output 5 WA  The number of C should not be zero, either.

Solution (Python):
S = input()

flag = False
if S[0] == "A":
    flag = True
    S = S.replace("A", "a", 1)

count = 0
for i in range(2, len(S) - 1):
    if S[i] == "C":
        count += 1
        S = S.replace("C", "c", 1)
if count != 1:
    flag = False

if not S.islower():
    flag = False

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

Solution (Python):
S = list(input())
ans = 'WA'
if S[0] == 'A' and S[2:len(S)-1].count('C') == 1 and S.count('A') ==1 and S.count('C') == 1:
    komozi =''
    for i in S:
        if i == 'A' or 'C':
            i = i.replace('A','')
            i = i.replace('C','')
        komozi += i
    if komozi.islower():
        ans = 'AC'
print(ans)

Solution (Python):
S = input()

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

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

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

ans = 'AC'
count = 0

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

s = 'a' + s[1:]

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

if count != 1:
    ans = 'WA'

if not s.islower():
    ans = 'WA'

print(ans)

Solution (Python):
sml='Cqwertyuiopasdfghjklzxcvbnm'

s=input()
n=len(s)
if s[0]=='A' and s[2:n-1].count('C')==1 and set(s[1:])<=set(sml):
  print('AC')
else:
  print('WA')

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

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

Solution (Python):
a = list(input())
flg = 1
c_flg = 0
for i in range(len(a)):
    if i == 0:
        if a[0] != 'A':
            flg = 0
            break
    else:
        if 2 <= i <= len(a) - 2:
            if a[i] == 'C':
                c_flg += 1
            else:
                if a[i].isupper():
                    flg = 0
                    break
        else:
            if a[i].isupper():
                flg = 0
                break

if flg and c_flg == 1:
    print('AC')
else:
    print('WA')

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

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

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

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

    num_upper = 0
    for c in list(s):
        if c.isupper():
            num_upper += 1

    if num_upper > 2:
        return False

    return True


s = input().strip()
print('AC') if valid(s) else print('WA')

Solution (Python):
a=input();b=a[1:].replace('C','');print('WAAC'[a[0]=="A"and 1==a[2:-1].count("C")and b.lower()==b::2])

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

Solution (Python):
def main():
  S = input()
  flag1 = (S[0] == 'A')
  flag2 = (S[2:-1].count('C') == 1)
  flag3 = (S.replace('A', '').replace('C', '').lower()
           == S.replace('A', '').replace('C', ''))

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


if __name__ == "__main__":
  main()

Solution (Python):
s = str(input())
small = "qazwsxedcrfvtgbyhnujmikolp"
ans = "AC"

if s[0] != "A":
    ans = "WA"
    
if s[1] not in small:
    ans = "WA"
    
if s[-1] not in small:
    ans = "WA"
    
ccount = 0
for i in range(2,len(s)-1):
    if s[i] not in small:
        if s[i] == "C":
            ccount+=1
        else:
            ans = "WA"
            
if ccount != 1:
    ans = "WA"
    
print(ans)

Solution (Python):

S = input()

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

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

Solution (Python):
import sys
s = input()
judge = 0
if s[0] == "A":
    judge += 1

if s[1] != "C" and s[len(s) -1] != "C" and s.count("C") == 1:
    judge += 1

s = s.replace("A","a").replace("C","c")

if s.islower() and judge == 2:
    print("AC")
else:
    print("WA")

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


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

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

if len(re.findall("[A-Z]", S)) != 2:
    print("WA")
    exit()

print("AC")

Solution (Python):

def referee(text):
    if text[0] != "A":
        return "WA"

    if text[1] == "C":
        return "WA"

    if text[1].isupper():
        return "WA"

    Cnum = 0

    for i in range(2, len(text)):
        if (text[i] == "C"):
            Cnum += 1
            if Cnum > 1:
                return "WA"
            continue

        if (text[i].isupper()):
            return "WA"

    if (text[-1] == "C"):
        return "WA"

    if (Cnum == 0):
        return "WA"

    return "AC"


if __name__ == "__main__":
    a = input()
    print(referee(a))

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

Solution (Python):
import re

string  = input()

m = re.match('A[a-z]+C[a-z]+',string)

if m != None:
  if m.group() == string:
    print('AC')
    exit()
print('WA')

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

flag=False
slen=len(s)
s_3_2=s[2:slen-1]

if s[0]=="A":
    if s_3_2.count("C")==1:
        s=s.replace("A","")
        s=s.replace("C","")
        if s.islower():
            ans="AC"

print(ans)

Solution (Python):
S = input().rstrip()
flg = False
if S[0] == "A":
    flg = True
if flg:
    S_sep = S[2:-1]
    index = S_sep.find("C") + 2
    if index == 1:
        flg = False
if flg:
    for i in range(1, len(S)):
        if i != index:
            if S[i].isupper():
                flg = False

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

Solution (Python):
S=input()
S=list(S)
Check2=[]
Key=True

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

Check2=S[2:len(S)-1]
if Check2.count('C')!=1:
    Key=False

if Key==True:
    S.remove('A')
    S.remove('C')
    S=''.join(S)
    if str.islower(S)!=True:
        Key=False
    
if Key==True:
    print('AC')
else:
    print('WA')

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

ans = 'AC'
length = len(s)

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

s[0] = 'a'
cnum = 0

for i in range(2,length-1):
    if s[i] == 'C':
        cnum = cnum + 1
        s[i] = 'c'

if cnum != 1:
    ans = 'WA'
strs = ''.join(s)


if strs.islower() == False:
    ans = 'WA'

print(ans)

Solution (Python):
import sys

str = input()

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

str = str.replace('A', 'a', 1)

flag = False

for i in range(2, len(str) - 1) :
    if str[i] == 'C':
        str = str.replace('C' , 'c', 1)
        flag = True
        break
        
if not flag :
    print("WA")
    sys.exit()

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

Solution (Python):
import string

N = input()

if N[0] == 'A' and N.count('A') == 1 and N.count('C') == 1 and N[2:-1].count('C') == 1 and sum(1 for c in N if c.isupper()) == 2:
  print('AC')
else:
  print('WA')

Solution (Python):
s = input()
l = []
cnt = 0

for i in s:
    l.append(i)
if (l[0]=='A') and (l[2:-1].count('C')==1):
        idx =l[2:-1].index('C')
        idx += 2
        del l[idx]
        del l[0]
        for i in range(len(l)):
            if l[i].islower()==True:
                cnt += 1
        if cnt == len(l):
            print('AC')
        else:
            print('WA')
    
else:
    print('WA')

Solution (Python):
a=input()
b=a[1:].replace("C","")
c=b.lower()
print(["WA","AC"][a[0]=="A" and a[2:-1].count("C")==1 and b==c])

Solution (Python):

import sys
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(S: str):
    a = S[0] == 'A'
    bs = list(filter(lambda x: x != 'C', S[2:-1]))
    cs = list(filter(lambda x: ord('A') <= ord(x) <= ord('Z'), [S[1]] + bs + list(S[-1:])))
    r =  a and len(bs) == (len(S[2:-1]) - 1) and len(cs) == 0
    return 'AC' if r else 'WA'


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    result = solve(S)
    print(result)

if __name__ == '__main__':
    main()

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

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

if S[0] == "A":
    for i in range(2,len(S)-1):
        if S[i] == "C":
            memo = i
            break
    if memo > 0:
        S = S[1:]
        S = S[:memo-1] + S[memo:]
        if S.islower():
            print("AC")
            exit()
print("WA")

Solution (Python):
def check(s):
    if s[0] != 'A':
        return False
    c = s.find('C')
    rc = s.find('C')
    if c != rc:
        return False
    if c < 2 or len(s)-1 <= c:
        return False
    return ''.join(sorted(s)[2:]).islower()

print(['WA','AC'][check(input())])

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

Solution (Python):
small  = [chr(i) for i in range(97,97+26)]
S = list(input())
n = len(S)
if S[0] != 'A' :
    print('WA')
else :
    cnt = 0
    for i in range(2,n-1) :
        if S[i] == 'C'  :
            cnt += 1

    if cnt != 1 :
        print('WA')
    else :
        c = 0
        for i in S :
            if i in small :
                c += 1
        
        if c != n-2 :
            print('WA')
        else :
            print('AC')

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

Solution (Python):
S = input()
ans = "AC"
if S[0] != "A":
  ans = "WA"
else:
  count_c = 0
  for i in range(1,len(S)):
    if 2 <= i <= len(S)-2 and S[i] == "C":
      count_c += 1
      continue
    if not S[i].islower():
      ans = "WA"
  if count_c != 1:
    ans = "WA"
print(ans)

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

s = list(input())



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

cnt = 0

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


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



del(s[index])
del(s[0])


s = ''.join(s)

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

Solution (Python):
A=list(input())
cnt = 0
if A[0] == "A":
    A[0]="a"
    if A[2:-1].count("C")==1:
        A[A.index("C")]="c"
        a="".join(A)
        if a.islower():
            cnt+=1
if cnt==1:
    print("AC")
else:
    print("WA")

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

Solution (Python):
S = input()
AS = ''
flag = False
hereC = 0

if S[0]=='A' and S[2:-1].count('C') == 1:
    flag = True
    hereC = S[2:-1].find('C')+2
for i in range(1,len(S)):
    if i != hereC:
        AS += S[i]

if flag and AS.islower():
    print('AC')
else:
    print('WA')

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

string = ''
if S[0] == 'A':
    for i in range(len(S)):
        if (i > 1) and (i < (len(S) - 1)):
            string += S[i]
        
    if string.count('C') == 1:
        
        
        newS = S.replace("C", "")
        

        if newS[1:].islower():
            print('AC')
            sys.exit()

print('WA')

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 = S.replace("A","").replace("C","")
        cnt2 = 0
        for i in range(len(S)):
            if S[i].islower():
                cnt2 += 1
        if cnt2 == len(S):
            print("AC")
            exit()

print("WA")

Solution (Python):
import sys

s = input()
C_count = 0

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

if C_count != 1:
    print('WA')
    sys.exit()
else:
    print('AC')

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

Solution (Python):
s = str(input())
t = s[2:-1]
a = 0
for i in s:
    if i.isupper():
        a += 1
if s[0] == "A" and t.count("C") == 1 and a == 2:
    print("AC")
else:
    print("WA")

Solution (Python):
a = input()
b = a[2:-1]
if a.startswith("A"):
    if b.count("C") == 1:
        c = list(a)
        c.remove("A")
        c.remove("C")
        for i in c:
            if i.isupper():
                print("WA")
                exit()
        print("AC")
        exit()
print("WA")

Solution (Python):

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

Solution (Python):

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

Solution (Python):
import sys

S = str(input())

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

temp = S.replace('A', '').replace('C', '')
if temp.islower():
    print('AC')
else:
    print('WA')

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

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

Solution (Python):
S = input()

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

Solution (Python):
S = input()

ans = 'AC'
count = 0
for i in range(len(S)):
    if i==0 and S[i] != 'A':
        ans = 'WA'
        break
    if i!=0 and S[i] != 'C' and S[i].isupper():
        ans = 'WA'
        break
    if (2 <= i <= len(S)-2) and S[i] == 'C':
        count += 1

if count != 1:
    ans = 'WA'

print(ans)

Solution (Python):
S = input()

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

Solution (Python):
def chk(s):
    if s[0]!="A" or s[2:len(s)-1].count("C")!=1: return "WA"
    l=s.index("C")
    for i in range(len(s)):
        if i not in [0,l] and s[i] not in "abcdefghijklmnopqrstuvwxyz": return "WA"
    return "AC"
    


s=input()

print(chk(s))

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

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

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

Solution (Python):
S = input()

chrs = set() 

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

ccnt = 0 
for c in S[2:len(S)-1]:
  if c == 'C': ccnt += 1

if ccnt != 1:
  print('WA')
  exit()
  

chrs.add(S[1:2]) 
for c in S[2:len(S)-1]: 
  chrs.add(c)
chrs.remove('C') 
chrs.add(S[len(S)-1:len(S)])


for ng in range(ord('A'), ord('Z')+1, 1):
  if chr(ng) in chrs:
    print('WA')
    exit()
    

print('AC')

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

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

  C_counter = 0
  for n in s[2:-1]:    
    if n == 'C':
      C_counter += 1

  if C_counter != 1:
    print('WA')
    return

  for n in s:
    if n == 'A' or n == 'C':
      continue
    if not n.islower():
      print('WA')
      return
  print('AC')
  return




main()

Solution (Python):
S=input()
if S[0]=='A':
    f1=True
else:
    f1=False

count=0
for s in S[2:-1]:
    if s=="C":
        count+=1
if count==1:
    f2=True
else:
    f2=False

f3=True
for s in S:
    if s=="A" or s=="C":
        continue
    if s!=s.lower():
        f3=False
        break

if f1 and f2 and f3:
    print("AC")
else:
    print("WA")

Solution (Python):
s = input()

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

Solution (Python):
s=input()
ans=0
if s[0]=='A':
  ans+=1
  s=s[1:]
if 'C' in s[1:-1]:
  ans+=1
  for i in range(1,len(s)-1):
    if s[i]=='C':
      s=s[:i]+s[i+1:]
      break
count=0
for i in range(len(s)):
  if s[i] in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
    count+=1
if count==0:
  ans+=1
print("AC" if ans==3 else "WA")

Solution (Python):


S = [i for i in input()]
count = 0

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

if S[1:-1].count('C') == 1:
    count += 1
    S.remove('C')

    if ''.join(S).islower():
        count += 1

print('AC' if count == 3 else '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 all([ord(c) >= 97 for c in S]):
        print("AC")
        quit()
print("WA")

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

Solution (Python):
def main():
	S = input()
	ac = S[0] == "A"
	ac = ac and S[2:-1].count("C") == 1
	ac = ac and S.replace("A", "").replace("C", "") == S.replace("A", "").replace("C", "").lower()

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

if __name__ == '__main__':
    main()

Solution (Python):

S =input()

if S[0]=="A" and S[2:len(S)-1].count('C')==1 and S.replace('A',"").replace('C',"")==S.replace('A',"").replace('C',"").lower():
    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):
import sys

s = input()

if s[0] == "A" and s.count("C") == 1 and "C" in s[2:-1]:
    ss = set(s)
    ss.remove("A")
    ss.remove("C")
    SS = set([i.upper() for i in ss])
    if len(ss & SS) == 0:
        print("AC")
        sys.exit()

print("WA")

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

Solution (Python):
import sys

S = [i for i in input()]
if S[0] != "A":
    print("WA")
    sys.exit()
else:
    S[0] = 'a'

ct = 0
for i in range(len(S[2:-1])):
    if S[i+2] == "C":
        S[i+2] = "c"
        ct += 1
    if ct > 1:
        print("WA")
        sys.exit()
if ct != 1:
    print("WA")
    sys.exit()

for i in S:
    if "a" <= i <= "z":
        pass
    else:
        print("WA")
        sys.exit()

print("AC")

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

Solution (Python):
S = input()

if S[0] == 'A' and S[2:len(S)-1].count('C') == 1:
    for s in S[1:]:
        if s not in ('C') and s.isupper():
            print('WA')
            exit()
    print('AC')
else:
    print('WA')

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

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

if cnt!=1:
	a="WA"

for i in range(1, len(s)):
	if s[i]!="C" and ord(s[i]) < ord("a"):
		a="WA"

print(a)

Solution (Python):
S = input()

countA = 0
countC = 0
for i in range(len(S)):
    if i == 0:
        if S[i] != 'A':
            print('WA')
            quit()
        else:
            countA += 1
            continue
    if S[i] == 'C':
        if i < 2 or i == len(S)-1:
            print('WA')
            quit()
        countC += 1
    elif not S[i].islower():
        print('WA')
        quit()
    if countA > 1 or countC > 1:
        print('WA')
        quit()

if countA != 1 or countC != 1:
    print('WA')
    quit()
print('AC')

Solution (Python):
S = input()

if S[0] == 'A' and S[2:-1].count('C') == 1:
    if S.replace('A', '').replace('C', '').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.index('C')
    if S[1:c].islower() and S[c+1:].islower():
        print('AC')
        exit()


print('WA')

Solution (Python):
S = input()
l = len(S)
A = list(S)
flg = 0
if 'C' in A:
    C = A.index('C')
else:
    print('WA')
    flg = 1

if S[0] == 'A' \
and S[2:l-1].count('C') == 1 \
and S[1:C].islower() \
and S[C+1:].islower():
    print('AC')
else:
    if flg == 0:
        print('WA')

Solution (Python):
S = input()

if S[0] == 'A':
    f1 = True
else:
    f1 = False

C_cnt = 0
for s in S[2:-1]:
    if s == 'C':
        C_cnt += 1
if C_cnt == 1:
    f2 = True
else:
    f2 = False

f3 = True
for s in S:
    if s == 'A' or s == 'C':
        continue
    if s != s.lower():
        f3 = False
        break

if f1 and f2 and f3:
    print('AC')
else:
    print('WA')

Solution (Python):


S = [i for i in input()]
count = 0

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

if S[1:-1].count('C') == 1:
    count += 1
    S.remove('C')

    if ''.join(S).islower():
        count += 1

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

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

Solution (Python):
S = input()
if(S[0]=='A' and S[2:-1].count('C') == 1):
  cnt = 0
  for i in S:
    if(not (97<=ord(i) and ord(i)<=122)):
      cnt+=1
  if(cnt==2):
    print('AC')
  else:
    print('WA')
else:
  print('WA')

Solution (Python):

import sys
import itertools
import collections
import functools
import math
from queue import Queue
INF = float("inf")


def solve(S: str):

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

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

    flag = False
    for i, c in enumerate(S):
        if i == 0:
            continue
        if ord("a") <= ord(c) and ord(c) <= ord("z"):
            continue
        elif 1 < i and i < len(S)-1 and c == "C" and flag == False:
            
            flag = True
            continue
        else:
            print("WA")
            return
    print("AC")

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    solve(S)


if __name__ == '__main__':
    main()

Solution (Python):
from collections import Counter
from functools import reduce
import fractions
import math
import statistics
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]  
def LF(): return [float(x) for x in sys.stdin.readline().split()]  
def LS(): return sys.stdin.readline().split()  
def MI(): return map(int, sys.stdin.readline().split())  
def II(): return int(sys.stdin.readline())  
def IS(): return input()  
def P(x): return print(x)
def C(x): return Counter(x)
def GCD_LIST(numbers):  
    return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers):  
    return reduce(LCM, numbers)
def LCM(m, n):
    return (m * n // fractions.gcd(m, n))


s = IS()
if s[0] == 'A' and s[2:len(s)-1].count('C') == 1 and ''.join([s[i] for i in range(1, len(s)) if not i == s.index('C')]).islower():
    print('AC')
else:
    print('WA')

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

if (S[0] == "A"):
    Flag += 1

if (S[2:-1].count("C") == 1):
    Flag += 1

if (Flag == 2):
    S.remove("A")
    S.remove("C")
    if (str(S).islower()):
        Flag += 1

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

Solution (Python):
import string
import sys
s = str(raw_input())
if (s[0] == 'A') & (s[2:-1].count('C') == 1):
	if (s.count('A') == 1) & (s.count('C') == 1):
		strans = s.translate(string.maketrans("AC", "ac"))
		slower = s.lower()
		if strans == slower:
			print 'AC'
			sys.exit()
print 'WA'

Solution (Python):
S = input()
if(S[0]=='A' and S[2:-1].count('C') == 1):
  cnt = 0
  for i in S:
    if(not (97<=ord(i) and ord(i)<=122)):
      cnt+=1
  if(cnt==2):
    print('AC')
  else:
    print('WA')
else:
  print('WA')

Solution (Python):
S = input()

ans = 0

for i in S:
  if str.islower(i):
    ans += 1

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

if S[0] == 'A' and s.count('C') == 1 and ans == len(S)-2:
  print('AC')
else:
  print('WA')

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

print(ans)

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

print("WA")

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

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

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

        l = list(map(ord, S))
        i = 0
        while i < len(l):
            if l[i] >= 97 and l[i] <= 122:
                i += 1
            else:
                print('WA')
                break
        if i == len(l):
            print('AC')
    else:
        print('WA')
else:
    print('WA')

Solution (Python):
S = (input())
l = len(S)
for i,c in enumerate(S[2:],2):
    if c == "C":
        break
tmp = S[1:i]+S[i+1:]
if (i != l-1) and (S[0]=="A") and(tmp.lower()==tmp):
    print("AC")
else:
    print("WA")

Solution (Python):
l=list(input())
if l[0]=="A":
  del l[0]
  c=0
  p=0
  for i in range(1,len(l)-1):
    if l[i]=="C":
      c+=1
      p=i
  if c==1:
    del l[p]
    if str.islower("".join(l)):
      print("AC")
    else:
      print("WA")
  elif c!=1 :
    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():
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Solution (Python):
import sys
def solve(S):
    if not S[0] == 'A':
        return False
    cnt = 0
    c = 0
    for i in range(2,len(S)-1):
        if S[i] == 'C':
            cnt = cnt+1
            c = i
    if not cnt == 1:
        return False
    for i in range(len(S)):
        if not (ord(S[i]) <= ord('z') and ord(S[i]) >= ord('a')):
            if(i == 0 or i == c):
                continue
            else:
                return False
    return True
            
S = input()
print("AC" if solve(S) else "WA")

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

Solution (Python):
from sys import stdin
S=(stdin.readline().rstrip())
flag=0
if S[0] != "A":
    flag=1
if S[2:-1].count("C") != 1:
    flag=1
for j in S.replace("A","").replace("C",""):
    if j.islower() != True:
        flag=1
if flag == 1:
    print("WA")
else:
    print("AC")

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

Solution (Python):


s = list(input())

answer = True

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

c = 0


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

if c != 1:
    answer = False

capital = 0


for i in range(len(s)):
    if s[i].isupper():
        capital += 1

if capital != 2:
    answer = False

if answer:
    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 len([i for i in S if i.islower()]) != len(S) - 2:
    ans = False

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