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 = str(input())
alp = "ABDEFGHIJKLMNOPQRSTUVWXYZ"
if S[0] == 'A' and S.count('C') == 1 and S[2:-1].count('C') == 1:
  for i in range(1,len(S)):
    if S[i] in alp:
      print("WA")
      exit()
  print("AC")
else:
  print("WA")

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

Solution (Python):
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

s = ns()

if s[0] == 'A' and s[2:-1].count('C') == 1:
    indx = 2 + s[2:-1].index('C')
    for i in range(len(s)):
        if i != 0 and i != indx and s[i] != s[i].lower():
            break
    else:
        print('AC')
        exit()

print('WA')

Solution (Python):

s = input()
alphabets = 'abcdefghijklmnopqrstuvwxyz'

isMeet = 'AC'

if s[0] == 'A':
    if s[2:-1].count('C') == 1:
        t = s[1:].replace('C', '')
        for c in t:
            if c not in alphabets:
                isMeet = 'WA'
                break
    else:
        isMeet = 'WA'
else:
    isMeet = 'WA'

print(isMeet)

Solution (Python):
S = input()

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

Solution (Python):
S = input()

success = False
if S[0] == 'A':
    if 'C' in S[2:-1]:
        ix = S.index('C')
        for i in range(1, len(S)):
            if i != ix:
                if S[i].islower():
                    pass
                else:
                    break
        else:
            success = True
if success:
    print('AC')
else:
    print('WA')

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

flag = True

if S[0] != 'A':
    flag = False
tmp = S[2:len(S)-1]
if not('C' in tmp and tmp.count('C') == 1):
    flag = False
for i in S:
    if not(i == 'A' or i == 'C') and i.isupper():
        flag = False
        break
print("AC" if flag else "WA")

Solution (Python):
s = input()

ans = True if s[0] == 'A' else False
num = 0
for i in range(1, len(s)):
    if s[i] == 'C' and i != len(s) - 1 and i != 1:
        num += 1
    elif ord(s[i]) <= ord('Z') and ord(s[i]) >= ord('A'):
        ans = False
        break

if num != 1:
    ans = False

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

Solution (Python):
S = input()
L = [chr(i) for i in range(97, 97+26)]
if S[0] == "A":
  c = 0
  for i in range(2,len(S)-1):
    if S[i] == "C":
      c +=1
      k = i
  if c == 1:
    T = "AC"
    for j in range(1,len(S)):
      if j != k:
        if not S[j] in L:
          T = "WA"
          break
    print(T)
  else:
      print("WA")
else:
  print("WA")

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

Solution (Python):
S = list(input())
c = 0
flag = 0
if S[0] == "A":
    for i in range(len(S)-3):
        if S[2+i] == "C":
            c += 1
            this = 2+i
    if c == 1:
        S.pop(this)
        S.pop(0)

    for i in S:
        if ord(i) < 97:
            flag = 0
            break
        else:
            flag = 1

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

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

if s[0] == "A" and s[2:-1].count("C") == 1:
  s.remove("A")
  s.remove("C")
  for c in s:
    if c.isupper() == True:
      print("WA")
      exit()
    else:
      continue
  print("AC")

else:
  print("WA")

Solution (Python):
s = list(input())
if s[0] != "A" or s.count("A") != 1 or s.count("C") != 1 or s[2:-1].count("C") != 1:
    print("WA")
    exit()
s.sort()
for i in range(2, len(s)):
    if s[i].isupper():
        print("WA")
        exit()
print("AC")

Solution (Python):
S = input()

ans = True

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

if not ('a' <= S[1] and S[1] <= 'z'):
    ans = False

cnt = 0
for s in S[2:-1]:
    if s == 'C':
        cnt += 1
    else:
        if not ('a' <= s and s <= 'z'):
            ans = False

if cnt != 1:
    ans = False

if not ('a' <= S[-1] and S[-1] <= 'z'):
    ans = False

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

Solution (Python):
s = input()
n = len(s)
alp = [chr(ord('a')+i)for i in range(26)]
a = s[0] == 'A'
b = s.count('C') == 1 and s.index('C') >=2 and s.index('C')<= n-2
c = True
for i in range(n):
    if i == 0:continue
    if s[i] == 'C':continue
    if s[i] not in alp:
        c = False
ok = a and b and c
if ok:print('AC')
else:print('WA')

Solution (Python):
s = input()

alphabet = 'abcdefghijklmnopqrstuvwxy'

ans = 'AC'

C_count = s.count('C')
if C_count == 1 and s[0] == 'A' and s[1] != 'C' and s[-1] != 'C':
    s = s.replace('C', 'c')

    for i in range(1, len(s)):
        if s[i] in alphabet:
            pass
        else:
            ans = 'WA'
            break
else:
    ans = 'WA'

print(ans)

Solution (Python):
def check(s):
  if s[0]!="A":
    return 0
  c = 0
  for i in range(1,len(s)):
    if s[1].isupper() or s[-1].isupper():
      return 0
    if s[i].isupper():
      if c!=0:
        return 0
      if s[i]=="C":
        c=1
      else:
        return 0
  if c==0:
    return 0
  return 1    

s = list(input())
if check(s):
  print("AC")
else:
  print("WA")

Solution (Python):
import sys
S = input()
cnt = 1
tmp = 0
if S[0] == 'A':
    for i in range(2, len(S)-1):
        if S[i] == 'C':
            tmp = i
            cnt -= 1
if cnt == 0:
    for i in range(len(S)):
        if S[i].isupper() is True and i != 0 and i != tmp:
            print('WA')
            sys.exit()
    print('AC')
else:
    print('WA')

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

Solution (Python):
S = input()
F = True
if S[0] != "A":
  F =False
if not("C" in S[2:-1]):
  F = False
if S[1:].count("C")==1:
  for i in range(1,len(S)):
    if S[i] != "C" and S[i].isupper():
      F = False
elif S[1:].count("C")>1:
  F = False
print("AC" if F else "WA")

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

else:
    print("WA")

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

Solution (Python):
a = input()
def atcoder(p):
    count = 0
    if p[0]=='A':
        count += 1
    
    count_C=0
    for i in range(len(p)-2):
        if p[i+2]=='C':
            count_C += 1
    if count_C == 1:
        count += 1
    
    count_c = 0
    for i in range(len(p)-1):
        if p[i].upper() ==p[i]:
            count_c+=1
    if p[len(p)-1]==p[len(p)-1].upper():
        count_c+=2
    if len(p)==3:
        count_c+=2
    if count_c ==2:
        count += 1
    
    
    if count ==3:
        print('AC')
    else:
        print('WA')
         
atcoder(a)

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

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

Solution (Python):
s = input()
ans = 'WA'
a = []
if s[0] == 'A' and s[2:-1].count('C') == 1:
     a = list(s)
     a.remove('A')
     a.remove('C')
     a = str(a)
     if a.islower() == True:
          ans = 'AC'
print(ans)

Solution (Python):
S=input()
ans="WA"
if S[0]=="A" and "C" in S[2:len(S)-1]:
    A=list(S[1:])
    A.remove("C")
    A=str(A)
    if A.islower()==True:
        ans="AC"
print(ans)

Solution (Python):
s = input()
n = len(s)
Ccnt = 0
def end():
  print('WA')
  exit(0)
  return 
for i in range(n):
  if i == 0:
    if s[i] != 'A':end()
  else:
    if s[i].isupper():
      if 2<=i<n-1 and s[i] == 'C':Ccnt += 1
      else:end()
if Ccnt != 1:end()
print('AC')

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

if s[0]=="A" and "C" in s[2:n-1]:
    check=s[1:]
    check.remove("C")
    s="".join(check)
    if s==s.lower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
from __future__ import print_function

import sys

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd



import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


def lcm(n, m):
    return int(n * m / gcd(n, m))


def coprimize(p, q):
    common = fractions.gcd(p, q)
    return (p // common, q // common)


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def find_gcd(list_l):
    x = reduce(gcd, list_l)
    return x


def main():
    S = input().strip()

    okflag = 0
    okflag1 = 0
    okflag2 = 0

    if S[0] == 'A':
        okflag1 = 1
    if S[1].islower() and S[len(S)-1].islower():
        okflag2 = 1
    for i in range(2, len(S)-1):
        if S[i] == "C" and okflag == 0:
            okflag = 1
        elif S[i].islower():
            pass
        else:
            okflag = 0
            break

    if okflag == 1 and okflag1 == 1 and okflag2 == 1:
        print("AC")
    else:
        print("WA")


if __name__ == '__main__':
    main()

Solution (Python):
if __name__ == '__main__':

	s = input()
	flg = False
	
	if s[0] == "A":
		tmp = s[2:-1]
		if tmp.count("C") == 1:
			tmp2 = s.replace("A","")
			tmp2 = tmp2.replace("C","")
			if tmp2.islower() == True:
				flg = True

	if flg == True:print("AC")
	else:		print("WA")

Solution (Python):
import re
S = input()
result = re.match('^A[a-z]{1}[a-z]{0,6}C[a-z]{1,7}$', S)

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

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

match = re.search(r'A[a-z][a-z]*C[a-z]*[a-z]', S)
if match == None:
    print("WA")
    exit()
if match.group() == S:
    print("AC")
else:
    print("WA")

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

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

Solution (Python):
s = str(input())
S = [s[i] for i in range(len(s))]
fr = 0
count = 0
if S[0] == 'A':
    S.pop(0)
else:
    fr = 1
for i in range(1,(len(S)-1)):
    if S[i] == 'C' and count == 0:
        S.pop(i)
        count += 1
s = ''.join(S)
if s.islower() and count == 1 and fr == 0:
    print('AC')
else:
    print('WA')

Solution (Python):
S = input()

flag = True
c_count = 0
for i in range(0, len(S)):
  if i == 0:
    if S[i] != "A":
      flag = False
      break
  elif i >= 2 and i <= (len(S) - 2):
    if S[i] == "C":
      c_count += 1

  if ord("A") <= ord(S[i]) and ord(S[i]) <= ord("Z"):
    if ord("A") != ord(S[i]) and ord("C") != ord(S[i]):
      flag = False
      break

if flag and c_count == 1:
  print("AC")
else:
  print("WA")

Solution (Python):
s_list = list(input())
n = len(s_list)
c_count = 0
if s_list[0] == "A":
    for s in s_list[2:-1]:
        if s == "C":
            c_count += 1
    if c_count == 1:
        if all([(s_list[i] == "C" and 2 <= i <= n - 2) or s_list[i].islower() for i in range(1, n)]):
            print("AC")
            exit()
print("WA")

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 = list(input())
ans = "WA"

if S[0] == "A":
    C_num = 0
    for char in S[2:-1]:
        if char == "C":
            C_num += 1
    if C_num == 1:
        check_S = S[1:]
        C_index = check_S.index("C")
        del check_S[C_index]
        frag = True
        for char in check_S:
            if char.isupper():
                frag = False
                break
        if frag == True:
            ans = "AC"

print(ans)

Solution (Python):
import re

S = input()

if('A' in S[0]):
    if('C' in S[2:-1]):
        if(len(re.findall('[A-Z]',S)) == 2):
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

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

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

Solution (Python):
S = input()
if S[0] == 'A':
    if S[2:-1].count('C') == 1:
        for s in S[1:]:
            if s != 'C':
                if s != s.lower():
                    break
        else:
            print('AC')
            exit()
print('WA')

Solution (Python):
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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


if __name__ == '__main__':
    main()

Solution (Python):
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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


if __name__ == '__main__':
    main()

Solution (Python):
import sys

def resolve():
    S = input()
    if S[0] == "A" and S[2:len(S)-1].count("C") == 1:
         if S[1:].replace("C", "").islower():
             print("AC")
             return
    print("WA")

if '__main__' == __name__:
    resolve()

Solution (Python):
word = input()
import re
dst = ""
if word[0] == "A":
    if len(re.findall("C", word[2:-1])) == 1:
        if len(re.findall(r"[a-z]", word)) == len(word) - 2:
            dst = "AC"
if not dst:
    dst = "WA"
print(dst)

Solution (Python):
S=input()

if S[0]!="A":
  print("WA")
else:
  cnt_C=0
  for i in range(2,len(S)-1):
    if S[i]=="C":
      cnt_C+=1
      
  if cnt_C!=1:
    print("WA")
  else:
    cnt_upper=0
    for i in range(len(S)):
      if S[i].isupper():
        cnt_upper+=1
        
    if cnt_upper!=2:
      print("WA")
    else:
      print("AC")

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

Solution (Python):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


if __name__ == '__main__':
    s = input()
    count =0

    for i in range(len(s)):
        if s[0] != "A":
            count += 2
        if s[i] =="C" :
            if i < len(s)-1 and i >1:
                count +=1
            else:
                count+=2
        elif i>0 and ( ord(s[i]) <97 or ord(s[i]) >122):
            count += 2

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

Solution (Python):










"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
 
def main():
  s = input()
  if s[0] == 'A':
    Cs = s[2:len(s)-1]
    
    if Cs.count('C') == 1:
      s = s.replace('A',"").replace('C',"")
      for i in range(len(s)):
        
        if 'a' <= s[i] <= 'z':
          pass
        else:
          print('WA')
          exit()
      print('AC')
    else:
      print('WA')
    
    
  else:
    print('WA')
  
  
if __name__ == '__main__':
  main()

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

bl = False
s1 = s[1]
s2 = s[2:len(s)-1]
s3 = s[-1]

if s[0] == 'A' and s[2:len(s)-1].count('C') == 1:
    s2.remove('C')
    s2 = ''.join(s2)
    ss = s1+s2+s3
    if ss.islower():
        bl = True

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

Solution (Python):
S = str(input())
s = list(S)
u = s
p = 0
for i in range(2,len(s)-1):
        if s[i] == 'C':
            p = p + 1
for i in range(2,len(s)-p):
    if s[i] == 'C':
        if i != len(s) - 1:
            del s[i]
if s[0] == 'A':
    del s[0]
    if p == 1:
        q = ''.join(s)
        if q.islower() == True:
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Solution (Python):
from collections import Counter
l=input()
s=list(l)
k=0
if s[0]=='A':
    for i in range(2,len(s)-1):
        if s[i]=='C':
            k+=1
    if k==1:
        if l.replace('A', 'a').replace('C', 'c') == l.lower():print('AC')
        else:print('WA')
    else:print('WA')
else:print('WA')

Solution (Python):


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
s = input()
n = len(s)
if s[0] != 'A':
    print('WA')
    quit()
cnt = 0
for i in range(2,n-1):
    if s[i] == 'C':
        cnt += 1
    elif s[i] in alpha:
        print('WA')
        quit()
if cnt != 1:
    print('WA')
    quit()
if s[1] in alpha:
    print('WA')
    quit()
if s[-1] in alpha:
    print('WA')
    quit()
print('AC')

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

Solution (Python):


def solve():
    s = list(input())
    if s[0] == "A" and s[2:-1].count("C") == 1:
        s.remove("A")
        s.remove("C")

        if "".join(s).islower():
            print("AC")
            exit()

    print("WA")


if __name__ == "__main__":
    solve()

Solution (Python):

def AcCepted(s):

    ans = "WA"

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

    return ans

def main():
    s = str(input())
    print(AcCepted(s))

if __name__ == '__main__':
    main()

Solution (Python):
s = input()

if s[0] == 'A' and s[2:-1].count('C') == 1:
    for c in s[1:]:
        if c != 'C' and c in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
            print('WA')
            exit()
    print('AC')
else:
    print('WA')

Solution (Python):
list_S = list(input())
ans = "WA"
if list_S[0] == "A":
    list_S.remove("A")
    if "C" in list_S[1:-1]:
        list_S.remove("C")
        for c in list_S:
            if c not in ["q","a","z","w","s","x","e","d","c","r","f","v","t","g","b","y","h","n","u","j","m","i","k","o","l","p"]:
                ans = "WA"
                break
            else:
                ans = "AC"

print(ans)

Solution (Python):


def solve():
    s = list(input())
    if (s[0] == "A") and (s[2:-1].count("C") == 1):
        s.remove("A")
        s.remove('C')
        if str(s).islower():
            print("AC")
        else:
            print('WA')
    else:
        print('WA')


if __name__ == "__main__":
    solve()

Solution (Python):
s = input()
ans = 1

if s[0] == "A":
    ans += 1
    
part = s[2:-1]
if part.count("C") == 1:
    ans += 1
      
for i in range(len(s)):
    if 65 < ord(s[i]) <91 and ord(s[i]) != 67:
        ans -= 1
        
print("AWCA"[ans<3::2])

Solution (Python):
s = str(input())
n = len(s)
if s[0] == "A":
    cntC = 0
    for i in s[2: n - 1]:
        if i == "C":
            cntC += 1
    if cntC == 1:
        cnt = 0
        for j in s:
            if j.isupper():
                cnt += 1
        if cnt == 2:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
s = list(input())
ans = "AC"

if s[0] == "A" and "C" in s[2:-1] and s.count("C") == 1 and s[1].islower():
    for i in range(3, len(s)):
        if not s[i].islower() and s[i] != "C":
            ans = "WA"
            break
else:
    ans = "WA"

print(ans)

Solution (Python):
s = list(input())
alph = ["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"]
c = 1
m = 0
for i in range(len(s)):
    if i == 0:
        if s[i] != "A":
            c = 0
    elif i == 1 or i == len(s) - 1:
        if not s[i] in alph:
            c = 0
    else:
        if m == 0 and not s[i] in alph:
            if s[i] == "C":
                m += 1
            else:
                c = 0
        elif m == 1 and not s[i] in alph:
            c = 0
if m == 0:
    c = 0
print("AC" if c == 1 else "WA")

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

if s[0] != 'A':
    print('WA')
else:
    i = 0
    j = 0
    for k in range(2, len(s) - 1):
        if s[k] == 'C':
            i += 1
        if s[k].islower():
            j += 1
    if s[-1].islower() and s[1].islower():
        j += 2
    if i == 1 and j == len(s) - 2:
        print('AC')
    else:
        print('WA')

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

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

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

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

count = 0
if S[0] == "A":
    count += 1
    

vaa = 0
num=[0]
for j in range(2, len(S)-1):
    
    if S[j] == "C":
        vaa += 1
        num.append(j)

if vaa == 1:
    count += 1
    


















num = reversed(num)
S_pop = [S.pop(i) for i in num]
S_low = [i.lower() for i in S]




if S == S_low:
    count += 1

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

Solution (Python):
import math

s=input()
x=s.find("C")

ok=True

for i in range(len(s)):
    if i==0 or i==x:
        continue

    if not s[i].islower():
        ok=False




if(s[0]=='A' and 2<=x<=len(s)-2 and ok):
    print("AC")
else:
    print("WA")

Solution (Python):
s = list(str(input()))
import sys
if s[0] != 'A':
    print('WA')
    sys.exit()
s.remove('A')
s2 = s[1:-1]
if s2.count('C') != 1:
    print('WA')
    sys.exit()
s.remove('C')
low = list(map(str.lower, s))
if low != s:
    print('WA')
    sys.exit()
print('AC')

Solution (Python):



S = input()


def main():
    x = S[0] == 'A'
    y = S[2:-1].count('C') == 1
    z = sum([1 for s in S if 'A' <= s <= 'Z']) == 2
    if x and y and z:
        ans = "AC"
    else:
        ans = "WA"
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
S = input()

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


if S[0] != 'A':
    
    print('WA')
    quit()
    
if not 'C' in C_S and C_S.count('C') != 1:
    
    
    print('WA')
    quit()
c_index = S.index('C')
alpha = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(S)):
    if i == 0 or i == c_index:
        continue
    elif S[i] not in alpha:
        
        
        print('WA')
        quit()
    else:
        continue
print('AC')

Solution (Python):
S = input()

import sys

if S[0] != "A":
    print("WA")
    sys.exit()
else:
    if S[2:len(S)-1].count("C") != 1:
        print("WA")
        sys.exit()
    else:
        for i in range(1,len(S)):
            if 97 <= ord(S[i]) and ord(S[i]) <= 122:
                continue
            elif S[i] == "C":
                continue
            else:
                print("WA")
                sys.exit()
    print("AC")

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

Solution (Python):
s = input()

if s[0] != 'A':
    print("WA")
    exit()
cnt = 0
s_list = list(s)
s_list[0] = 'a'
for i in range(2, len(s) - 1):
    if s[i] == 'C':
        s_list[i] = 'c'
        cnt += 1
if cnt != 1:
    print("WA")
    exit()
s = "".join(s_list)
for i in range(len(s)):
    if ord(s[i]) >= ord("A") and ord(s[i]) <= ord("Z"):
        print("WA")
        exit()

print("AC")

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

print('WA')

Solution (Python):
S=input()
if S[0]!='A':
    print("WA")
    exit()
s=S[2:len(S)-1]

if s.count('C')!=1:
    print("WA")
    exit()
S1=list(S)
S1.remove('A')
S1.remove('C')
alpha="abcdefghijklmnopqrstuvwxyz"
for s in S1:
    if not('a'<=s<='z'):
    
        
        print("WA")
        exit()
print("AC")

Solution (Python):
S=input()
if S[0]!='A':
    print("WA")
    exit()
s=S[2:len(S)-1]

if s.count('C')!=1:
    print("WA")
    exit()
S1=list(S)
S1.remove('A')
S1.remove('C')
alpha="abcdefghijklmnopqrstuvwxyz"
for s in S1:
    if s not in alpha:
        
        print("WA")
        exit()
print("AC")

Solution (Python):
ans = True
key = 0
s = input()

for i in range(len(s)):
  if i == 0 and s[0] != "A":
    ans = False
  if (i == 1 or i == len(s)-1) and s[i].isupper():
    ans = False
  if 2 <= i <= len(s)-2:
    if s[i] == "C":
      key += 1
    elif s[i].isupper():
      ans = False
if key == 1 and ans:
  print("AC")
else:
  print("WA")

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

Solution (Python):
import sys
S = input()
SL = list(S)
N = len(S)

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

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

SL[0] = "a"
for i in range(2,N-1):
    if SL[i] == "C":
        SL[i] = "c"
        break
S2 = "".join(SL)
if not S2.islower():
    print("WA")
    sys.exit()
print("AC")

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

cnt_second = 0
second = s[2:-1]
for x in second:
    if x == 'C':
        cnt_second += 1

if cnt_second != 1:
    flag = False

cnt_third = 0
for x in s:
    if x.isupper():
        cnt_third += 1

if cnt_third != 2:
    flag = False

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

Solution (Python):
s=input()
p=len(s)
fir=s[0]=="A"
sec=s.count("C",2,-1)
thi=sum(map(lambda x:x.islower(), s))==p-2
if fir and sec and thi:
    print("AC")
else:
    print("WA")

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

Solution (Python):
S = input()
N = len(S)
 
cond1 = True if S[0] == 'A' else False
cond2 = True if S[2:-1].count('C') == 1 else False
cond3 = True if sum(map(lambda x: x.islower(), S)) == N-2 else False
 
print('AC') if cond1 and cond2 and cond3 else print('WA')

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

if S[0]=="A":
  if S[2:-1].count("C")==1:
    pos=S.find("C")
    T=S[1:pos]+S[pos+1:]
    if T.islower():
      print("AC")
      flag=True
      
if flag==False:
  print("WA")

Solution (Python):
S = input()
l = len(S)
cnt = 0
if (S[0] == "A"):
    for i in range(2, l - 1):
        if (S[i] == "C"):
            cnt += 1

    if (cnt == 1):
        f = True
        for i in range(len(S)):
            if (S[i] != "A") and (S[i] != "C"):
                if (S[i].isupper()):
                    f = False
                    break
        if (f):
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")