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()
count = 0
for c in s:
  if c.isupper():
    count += 1

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

Solution (Python):
s=input()
if s[0]!="A" or s[2:-1].count("C")!=1:
      print("WA")
      exit()

s=list(s)
s[0]="a"
s.remove("C")
if "".join(s).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()

s=list(s)
s[0]="a"
s.remove("C")
if "".join(s).islower():
      print('AC')
else:
      print("WA")

Solution (Python):
S = str(input())
j_count = 0
X = []

for s in S:
    X.append(s)

if X[0] == 'A':
    j_count += 1
    if X[2:len(X)-1].count('C') == 1:
        j_count += 1
        X.remove('A')
        X.remove('C')
        S_n = ''.join(X)
        if S_n.islower():
            j_count += 1

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

Solution (Python):
s = input()
ret = True
c_num = 0
for i, char in enumerate(s):
    if i == 0 and char != 'A':
        
        ret = False
        break
    elif i == 0 and char == 'A': continue
    if not char.islower():
        if 2 <= i <= len(s)-2:
            if char == 'C':
                c_num += 1
            else:
                
                ret = False
                break
        else:
            
            ret = False
            break
    

if c_num != 1:
    ret = False
    
print('AC' if ret else 'WA')

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

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

if re.fullmatch(r'A[a-z]+C[a-z]+', S):
    print('AC')
else:
    print('WA')

Solution (Python):
import re

S = input()
print('AC' if re.fullmatch(r'A[a-z]+C[a-z]+', S) else 'WA')

Solution (Python):
S = list(input())
small = [chr(i) for i in range(97,97+26)]
count = 0
ans = 'AC'
for i in range(len(S)):
    if i == 0:
        if S[i] != 'A':
            ans = 'WA'
            break
    elif i == 1:
        if S[i] not in small:
            ans = 'WA'
            break
    elif i != len(S)-1:
        if S[i] == 'C':
            count += 1
        elif S[i] not in small:
            ans = 'WA'
            break
    else:
        if S[i] not in small:
            ans = 'WA'
if ans == 'AC' and count != 1:
    ans = 'WA'
print(ans)

Solution (Python):
s = input()

if s[0] != "A":
    print("WA")
elif s[1] == "C" or s[-1] == "C":
    print("WA")
elif "C" not in s:
    print("WA")
elif s.count("C") > 1:
    print("WA")
elif s.replace('A', 'a').replace("C", "c") != s.lower():
    print("WA")
else:
    print("AC")

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

first = S.pop(0)
if first != "A":
    print("WA")
else:
    second = S.pop(0)
    last = S.pop(-1)
    if second.isupper() or last.isupper():
        print("WA")
    else:
        count = 0
        while S != []:
            s = S.pop(0)
            if s == "C":
                count += 1
            elif s.isupper():
                count = 100

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

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

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

lis = S[2:-1]
if 'C' not in lis:
  print('WA')
  sys.exit(0)
  
if lis.count('C') > 1:
  print('WA')
  sys.exit(0)

l = S[:]
l.remove('A')
l.remove('C')
l = str(l)

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

Solution (Python):
s = input()

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

if s[2:len(s)-1].count('C') > 1 or s[2:len(s)-1].count('C') < 1:
	print("WA")
	exit(0)

s = s[1:]
s = s[0] + s[1:len(s)-1].replace("C", "") + s[len(s)-1]

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

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

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

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

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

Solution (Python):

s = input()

lowers = 'abcdefghijklmnopqrstuvwxyz'
is_satisfied = 'AC'

if s[0] == 'A' and s[2:-1].count('C') == 1:
    for letter in s:
        if letter != 'A' and letter != 'C':
            if letter not in lowers:
                is_satisfied = 'WA'
                break
else:
    is_satisfied = 'WA'

print(is_satisfied)

Solution (Python):
from sys import stdin

s = stdin.readline().rstrip()

if s[0] == "A":
    if s[2:-1].count("C") == 1:
        if sum(1 for c in s if c.isupper()) == 2:
            print("AC")
            exit()

print("WA")

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

Solution (Python):
import string

S = input()
C = [i + 2 for i, s in enumerate(S[2:-1]) if s == 'C']
U = [s for s in S[1:] if s in string.ascii_uppercase]

if S[0] == 'A' and len(C) == 1 and len(U) == 1:
    print('AC')
else:
    print('WA')

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

Solution (Python):
S = input()
n = len(S)
p = 0
if S[0] == 'A':
    p = 1
s = []
for i in range(2,n-1):
    s.append(S[i])
q = 0
if s.count('C') == 1:
    q = 1
if 'C' in s:
    s.remove('C')
s.append(S[1])
s.append(S[n-1])
r = 1
for i in range(n-2):
    x = s[i]
    t = ord(x)-97
    if 0<= t <= 25:
        continue
    else:
        r = 0
        break
ans = 'WA'
if p*q*r == 1:
    ans = 'AC'
print(ans)

Solution (Python):
s=input()
ans1=False
if s[0]=="A":
    ans1=True
ans2=False
x=len(s)
for i in range(2,len(s)-1):
    if s[i]=="C":
        ans2=True
        x=i
        break
ans3=(s[1:x]+s[x+1:]).islower()

if ans1 and ans2 and ans3:
    print("AC")
else:
    print("WA")

Solution (Python):
S = input()
cnt = sum(ord(s) in range(97, 123) for s in S)
if (S[0]=='A' and 'C' in S[2:-1] and cnt+2 == len(S)):
    print('AC')
else:
    print('WA')

Solution (Python):
s = str(input())
ans = 'WA'
if (s[0]=='A'):
    if (s[2:-1].count('C')==1):
        i = s.find('C')
        rest = s[1:i]+s[i+1:]
        if rest.islower():
            ans='AC'
print(ans)

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

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

c = 0
check = 0

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

for i in range(len(S)):
  if not S[i].islower():
    check += 1

if S[0] != 'A':
  print('WA')
elif c == 1 and check == 2:
  print('AC')
else:
  print('WA')

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

Solution (Python):
s = input()
ans = 'WA'
c_ctn = 0
low_ctn = 0
if s[0] == 'A':
    for i in range(2, len(s) - 1):
        if s[i] == 'C':
            c_ctn += 1
for i in s:
    if i.islower():
        low_ctn += 1
if c_ctn == 1 and low_ctn == len(s) - 2:
    ans = 'AC'
print(ans)

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

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

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

Solution (Python):
import sys
s = input()
s = [c for c in s]
flg = False
if s[0] == 'A':
    if s[2:-1].count('C') == 1:
        if s.count('C') == 1:
            s.remove('A')
            s.remove('C')
            for c in s:
                if not c.islower():
                    flg = False
                    break
                flg = True
print('AC' if flg else 'WA')

Solution (Python):
s = input()
ans = "WA"
if s[0] == "A":
    cnt = 0
    for i in s[2:-1]:
        if i == "C":
            cnt += 1
    if cnt == 1:
        upper_cnt = 0
        for j in s:
            if j.isupper():
                upper_cnt += 1
        if upper_cnt == 2:
            ans = "AC"

print(ans)

Solution (Python):




import sys














def main():
    s = sys.stdin.readline().rstrip()
    
    if s[0] == 'A':
        s = s[1:]
        if 'C' in s[1:-1] and s.count('C') == 1:
            s = s.replace('C', 'a')
            if s.lower() == s:
                print('AC')
                exit()

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

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

Solution (Python):
s = input()
def BFunc(s):
    s = list(s)
    if s[0] != 'A':
        return False
    s.pop(0)
    c_cnt = 0
    for i in range(1, len(s) - 1):
        if s[i] is 'C':
            c_cnt += 1
            if c_cnt > 1:
                return False
            s.pop(i)
    if c_cnt != 1:
        return False
    for i in range(len(s)):
        if not s[i].islower():

            return False
    return True
if BFunc(s):
    print('AC')
else:
    print('WA')

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

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

Solution (Python):

import re

S = input()
flag = 0
if(S[0] == 'A'):
  if(len(re.findall('C', S[2:-1])) == 1):
    index = S[2:-1].find('C') + 2
    ss = 'a' + S[1:index] + 'c' + S[index+1:]
    if(S.lower() == ss):
      flag = 1

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

Solution (Python):
s = input()
if s[0] == "A" and s[2:-1].count("C") == 1 and sum("a" <= i <= "z" for i in s[1:]) == len(s)-2:
    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 = str(input())
hantei = True
if S[0]!='A':
  hantei = False
if S[2:-1].count('C') != 1:
  hantei = False
if S[1:].replace('C','') != (S[1:].replace('C','')).lower():
  hantei = False
print('AC' if hantei else'WA')

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

if s[0] == 'A':
    if s[2:-1].count('C') == 1:
        s.remove('C')
        if str(s[1:]).islower():
            ans = 'AC'

print(ans)

Solution (Python):



S = input()


ans = False
if S[0] == 'A' and S[1] != 'C' and S[2:len(S) - 1].count('C') == 1 and S.replace('A', '').replace('C', '').islower():
    ans = True


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

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

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

    margin = s[2:len(s) - 1]
    count = 0

    for i in margin:
        if i == "C":
            count += 1
        if count >= 2:
            print("WA")
            return

    if count != 1:
        print("WA")
        return
    s = s[1:]
    s = s[:s.find("C")] + s[s.find("C")+1:]
    if s.islower():
        print("AC")
        return
    else:
        print("WA")
        return


main()

Solution (Python):
S = input()
if not S[0] is "A":
  print("WA")
  exit()

subS = S[2:-1]
if not (("C" in subS) and (subS.count('C') == 1)):
  print("WA")
  exit()

subS = S.replace('A', '').replace('C','')
if not subS.islower():
  print("WA")
  exit()

print("AC")

Solution (Python):
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


def main():
    S = input()[:-1]
    
    if S[:1]!="A":
        print("WA")
        return
    if S[2:len(S)-1].count("C")!=1:
        print("WA")
        return
    for i in range(1, len(S)):
        if S[i:i+1].isupper() and S[i:i+1] not in "AC":
            print("WA")
            return
    
    print("AC")


if __name__ == '__main__':
    main()

Solution (Python):
S = list(input())
ans = "AC"
if S[0] != "A":
    ans = "WA"
else:
    count = 0
    for i in S[2:-1]:
        if i == "C":
            count += 1
    if count != 1:
        ans = "WA"
    else:
        for i in S:
            if i not in ["A","C"] and str.islower(i) != True:
                ans = "WA"
print(ans)

Solution (Python):
S = input()

count = 0

if S[0] == "A":
    count += 1
    
count_c = 0
for i in range(2, len(S)-1):
    if S[i] == "C":
        count_c += 1
if count_c == 1:
    count += 1
    
count_upper = 0
for i in range(len(S)):
    if S[i].isupper() == True:
        count_upper += 1
if count_upper == 2:
    count += 1
    
if count == 3:
    print("AC")
else:
    print("WA")

Solution (Python):
def is_upper_case(s):
  return not (ord('a') <= ord(s) <= ord('z'))

S = input()

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

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

upper_num = list(map(is_upper_case, S)).count(True)

if upper_num != 2: 
  print("WA")
  exit()

print("AC")

Solution (Python):
def isNotLower(s):
  return not (ord('a') <= ord(s) <= ord('z'))

S = input()

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

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

upper_num = 0
for s in S:
  if isNotLower(s):
    upper_num += 1

if upper_num != 2: 
  print("WA")
  exit()

print("AC")

Solution (Python):
def isNotLower(s):
  return not (ord('a') <= ord(s) <= ord('z'))

S = input()

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

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

upper_limit = 2 
for s in S:
  if isNotLower(s):
    upper_limit -= 1

  if upper_limit < 0:
    print("WA")
    exit()

print("AC")

Solution (Python):
s=input()

a=s[2:-1]
b=s.replace("A","").replace("C","")
ans=False
if s[0] == 'A':
    if a.count('C') == 1:
        if b.islower():
            ans=True

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

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

Solution (Python):
s  = input()

t  = s[2:-1]
count  = 0
k = 0
for i in range(len(t)):
  if t[i] == "C":
    count += 1
    k = i
s = list(s)
s.pop(k+2)
if s[0] == "A":
  s.pop(0)
  if str(s).islower() and count == 1:
    print("AC")
    exit()
    
print("WA")

Solution (Python):
s = input()

flg = True
if s[0] != 'A':
    flg = False
elif 'C' not in s[2:-1]:
    flg = False
elif s[2:-1].count('C') > 1:
    flg = False
elif not  s[1:].replace('C','').islower():
    flg = False
else:
    pass

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

Solution (Python):
s = list(input())
count = 0
flag = 1
if s[0] == "A":
    s[0] = s[0].lower()
else:
    flag = 0
for i in range(2, len(s)-1):
    if s[i] == "C":
        s[i] = s[i].lower()
        count += 1
ss = "".join(s)
if not(ss.islower()) or count != 1:
    flag = 0
if flag == 1: print("AC")
else: print("WA")

Solution (Python):
s = list(input())
count = 0
flag = 1
if s[0] == "A":
    s[0] = s[0].lower()
    for i in range(len(s)):
        if (i >= 2 and i <= len(s)-2) and s[i] == "C":
            s[i] = s[i].lower()
            count += 1
    for i in s:
        if str(i).isupper():
            flag = 0
            break
    if count != 1:
        flag = 0
else:
    flag = 0
if flag == 1: 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()

if s[0] == "A" and s[1].islower():
    if s[2:].count("C") == 1:
        idx = s.index("C")
        if s[1:idx].islower() and s[idx + 1 :].islower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("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):



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()
if s[0] == 'A' and 'C' in s[2:-1] and s.count('C') == 1:
    s = s[1:].replace('C','')
    if s == s.lower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Solution (Python):
S=input()
abc=[chr(i) for i in range(97,97+26)]
f=True

if S[0]=='A':
    S=S[1:]
else:
    f=False

if 'C' in S[1:-1]:
    S=S.replace('C','',1)
else:
    f=False

for c in S:
    if c not in abc:
        f=False
        break

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

Solution (Python):
S=input()
flag=1

if S[0]!='A':
    flag=0

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

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

if S!=S.lower():
    flag=0

print('WAAC'[flag::2])

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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)

Solution (Python):

S = str(input())










C_check = 0

if S[0]=="A":
    for i in range(1,len(S)):
        if S[i].isupper() == True:
            if i>=2 and i<=len(S)-2 and C_check==0 and S[i]=="C":
                C_check=1
            else:
                print("WA")
                break
    else:
        if C_check == 1:
            print("AC")
        else:
            print("WA")
else:
    print("WA")

Solution (Python):
s = input()

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

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

if s[0:2].count("C") != 0 and s[-2:].count("C") != 0:
    print("WA")
    quit()

for _s in s:
    if _s == "A" or _s == "C":
        continue

    if not _s.islower():
        print("WA")
        quit()

print("AC")

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

ac = False
if S[0] == "A":
    if S[2:len(S)-1].count("C") == 1:
        ac = True

upper = False
count = 0
for i in S:
    if i.isupper():
        count += 1

if count == 2:
    upper = True

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

Solution (Python):
S = input()

ans_1 = 1 if S[0] == "A" else 0

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


ans_2 = 1 if count_c == 1 else 0

check_str = S[1:c_i] + S[c_i+1:]

ans_3 = 1 if check_str.islower() == 1 else 0




print( "AC" if ans_1 and ans_2 and ans_3 else "WA")

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

Solution (Python):
S = input()

if S[0] == "A" and S[2:-1].count("C") == 1:
    ans = "AC"
    for s in S:
        if s not in "AC" and s.isupper():
            ans = "WA"
            break
else:
    ans = "WA"

print(ans)

Solution (Python):
S = input()

ret = 'WA'

if S[0] == 'A':
    if S[2:-1].count('C') == 1:
        n = S.find('C')
        S = list(S)
        S[n] = 'c'
        S = "".join(S)
        komoji = S[1:]
        s = S[1:].lower()

        if komoji == s:
            ret = 'AC'

print(ret)

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

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

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

s.remove("A")
s.remove("C")
s_in = "".join(s)

if not s_in.islower():
    print("WA")
    exit()

print("AC")

Solution (Python):





S=list(input())
S_int=list(map(lambda x:ord(x),S))

flg=False

if S[0]=="A":
    if S[2:-1].count("C")==1:
        remove_omoji=[x for x in S_int if x>96]
        if len(S_int)-2==len(remove_omoji): flg=True

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

Solution (Python):
s = input()

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

Solution (Python):
s=list(input())
c=0
if s[0]=="A" and "C" in s[2:-1]:
    s.remove("A")
    s.remove("C")
    for i in s:
        if i in "abcdefghijklmnopqrstuvwxyz":c+=1
        else:print("WA");break
    if c==len(s):print("AC")
    else:("WA")
else:print("WA")

Solution (Python):
s = input()

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

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

A = []
for i in S:
    if i != 'A' and i != 'C':
        A.append(i)
A=''.join(A)

B= list(S[2:-1])


if S[0] == 'A':
    if B.count('C') == 1:
        if A.islower():
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Solution (Python):
S = input()

ac = True

if S[0] != "A":
    ac = False

cnt = 0
for s in S[2:-1]:
    if s == "C":
        cnt += 1
if cnt != 1:
    ac = False

for s in S[1:]:
    if s != "C" and s.isupper():
        ac = False

if ac:
    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=list(input())

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

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

S.remove('C')
S.remove('A')

for i in S:
    if i not in 'abcdefghizklmnopqrstuvwxyz':
        print('WA')
        exit()


print('AC')

Solution (Python):
def solve(s):
    if(s[0] == "A"):
        v = s[1:]
        i = v.find("C")
        if(i >= 1 and i < len(v)-1):
            k = v[:i] + v[i+1:]
            if(k.islower()):
                return "AC"
    return "WA"
 
s = input()
print(solve(s))

Solution (Python):
S=input()
r='AC'
if S[0]!='A':
    r='WA'
count=0
for s in S:
    if str(s).isupper():
        count+=1
if count!=2:
    r='WA'
if 'C' not in S[2:-1]:
    r='WA'
print(r)

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

if S[0] == "A":
    if S[2:-1].count("C") == 1:
        if len(re.findall("[A-Z]", S)) == 2:
            print("AC")
            exit()
            
print("WA")

Solution (Python):
S = input()

ans = True

tmp_S1 = ""
tmp_S2 = ""
for i in range(len(S)):
    if S[i] == "A" or S[i] == "C":
        continue
    tmp_S1 += S[i]
    tmp_S2 += S[i]

if tmp_S1.lower() != tmp_S2:
    ans = False

if S[0] != "A":
    ans = False

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

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

Solution (Python):
s=list(input())
count=0
if s[0]!='A':
    count+=2
for i in range(2,len(s)-1):
    if s[i]=='C':
        count+=1

if count==1:
    s.remove('A')
    s.remove('C')    
    res=''.join(s)
    print('AC' if res.islower()==True else 'WA') 

else:
    print('WA')

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    s = str(input().rstrip('\n'))
    cnt = 0
    for i in range(len(s)):
        if i == 0:
            if s[i] != "A":
                print("WA")
                exit()
        elif 2 <= i <= len(s) - 2:
            if s[i] == "C":
                cnt += 1
            else:
                if s[i] != s[i].lower():
                    print("WA")
                    exit()
        else:
            if s[i] != s[i].lower():
                print("WA")
                exit()
    if cnt == 1:
        print("AC")
    else:
        print("WA")


if __name__ == '__main__':
    slove()

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

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

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

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

    rule1 = S[0] == 'A'
    rule2 = S[2:len(S)-1].count('C') == 1
    rule3 = S[1:].replace('C','').islower()

    if(rule1 and rule2 and rule3):
        print('AC')
    else:
        print('WA')

if __name__ == "__main__":
    main()

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

Solution (Python):
s = input()

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

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

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

cntL = 0
for i in range(len(s)):
    if s[i].islower():
        cntL+=1

if cntL != len(s)-2:
    print('WA')
    exit()

print('AC')

Solution (Python):
import sys
S = input()
if S[0] != 'A' or S[2:-1].count('C') != 1:
    print('WA')
    sys.exit(0)

cnt = 0
for c in S:
    if('a' <= c <= 'z'):
        cnt+=1

if(cnt == len(S)-2):
    print('AC')
else:
    print('WA')

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

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

ccnt = 0
for i in range(2,len(S)-1):
    if S[i] == 'C':
        ccnt += 1
if ccnt != 1:
    print('WA')
    sys.exit()

csml = 0
for i in range(len(S)):
    if S[i].isalpha() and S[i].islower():
        csml += 1
if csml == len(S)-2:
    print('AC')
else:
    print('WA')

Solution (Python):
S = list(input())
f1 = f2 = f3 = False
if S[0] == 'A':
    f1 = True
    del S[0]
if S[1:-1].count('C') == 1:
    f2 = True
    del S[S[1:-1].index('C')+1]
if ''.join(S).islower():
    f3 = True

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

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

if s[0]!='A':
    print('WA')
    exit()
else:
    del s[0]
    for i in range(len(s)-1):
        if s[i] =='C' and 0<i:
            del s[i]
            if not str.islower(str(s)):
                print('WA')
                exit()
            else:
                print('AC')
                exit()
        else:
            continue
    print('WA')
    exit()

Solution (Python):
S = input()

bool_list = []
if S[0] == 'A':
    bool_list.append(True)
    if S[2: -1].count('C') == 1:
        bool_list.append(True)
        C_index = S.index('C')
        if 'a' + S[1:C_index] + 'c' + S[C_index + 1:] == S.lower():
            bool_list.append(True)
        else:
            bool_list.append(False)
    else:
        bool_list.append(False)
else:
    bool_list.append(False)

if all(bool_list) is True:
    print('AC')
else:
    print('WA')

Solution (Python):
S = input()

def check() :
    if S[0] != 'A' or S[2:-1].count('C') != 1 :
        return 'WA'
    
    ret = 0
    for s in S :
        if ord(s) < 97 or 122 < ord(s) :
            ret += 1
            
    if ret != 2 :
        return 'WA'
        
    return 'AC'
    
print(check())

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

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

if 'C' not in s[2:-1]:
  ans = 'WA'
  
if s[2:-1].count('C') != 1:
  ans = 'WA'
  
if not s.replace('A', '').replace('C', '').islower():
  ans = 'WA'
  
print(ans)

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

Solution (Python):
import sys

input = sys.stdin.readline


def judg(s):
    if s[0] != "A":
        return False
    if "C" not in s[2:-1] and s[2:-1].count("C") != 1:
        return False
    del s[s.index("C")]
    s = "".join(s[1:])
    if s.lower() != s:
        return False
    return True


def main():
    s = list(input().strip())

    if judg(s):
        print("AC")
    else:
        print("WA")


if __name__ == "__main__":
    main()

Solution (Python):
s = input()
if not s[0] == "A":
  print("WA")
  exit()
elif not "C" in s[2:-1]:
  print("WA")
  exit()
ig = 2+s[2:-1].index("C")
for i in range(1,len(s)):
  if i == ig:
    continue
  if s[i].isupper():
    print("WA")
    exit()
print("AC")

Solution (Python):
S=input()


if S[0]=='A':
    
    
    if len([s for s in S[2:len(S)-1] if s=='C'])==1:

        
        s=S[1:S.index('C')]+S[S.index('C')+1:]
        if s==s.lower():
            print("AC")
        
        else:
            print("WA")

    else:
        print("WA")

else:
    print("WA")

Solution (Python):
n=input()
wa=0


if n[0]=="A" and n[2:len(n)-1].count("C")==1 and n[1]!="C" and n[len(n)-1]!="C":
    wa+=0
    import re
    a=re.sub('[AC ]', '',n)
else:
    wa+=1
    a=n
for i in range(len(a)):
    if 0<= ord(a[i]) - ord('a') <= 26:
        wa+=0
    else:
        wa+=1
if wa==0:
    print("AC")
else:
    print("WA")

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

if s[0] != "A" or s[1].isupper() or s[-1].isupper():
    print("WA")
    exit()

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

    elif s[i].isupper():
        print("WA")
        exit()

if count != 1:
    print("WA")

elif count == 1:
    print("AC")