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 = list(input())
N = len(S)
ans = 'AC'
a = 0 
for i in range(N):
    if i == 0:
        if S[i] != 'A':
            ans = 'WA'
            break
    elif i == 1:
        if S[i].islower() == False:
            ans = 'WA'
            break
    elif i == N - 1:
        if a != 1:
            ans = 'WA'
            break
        if S[i].islower() == False:
            ans = 'WA'
    else:
        if S[i] == 'C':
            a += 1
            if a > 1:
                ans = 'WA'
                break
        elif S[i].islower() == False:
            ans = 'WA'
            break
print(ans)

Solution (Python):




def resolve():
    import sys
    input = sys.stdin.readline
    s = input().rstrip()

    has_c = False

    for i, c in enumerate(s):
        if i == 0:
            if c != "A":
                print("WA")
                return
            continue
        if i in list(range(2, len(s) - 1)) and c == "C":
            if has_c:
                print("WA")
                return
            has_c = True
        else:
            if not c.islower():
                print("WA")
                return

    if not has_c:
        print("WA")
        return
    print("AC")

if __name__ == "__main__":
    resolve()

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):
def solve():
    S = input()
    if S[0] != 'A':
        return 'WA'
    cnt = 0
    for i in range(2, len(S)-1):
        if S[i] == 'C':
            cnt += 1
            C = i
    if cnt != 1:
        return 'WA'
    T = S[:C] + S[C+1:]
    Tset = set(list(T[1:]))
    sletter = set(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'])
    if sletter.union(Tset) != sletter:
        return 'WA'
    return 'AC'


def main():
    ans = solve()
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
S = input()

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

cnt = 0
for s in S:
    if s.isupper():
        cnt += 1
if cnt == 2:
    print("AC")
else:
    print("WA")

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


def read():
    S = input().strip()
    return S,


def solve(S):
    if S[0] != "A":
        return "WA"
    c_index = -1
    for i in range(2, len(S)-1):
        if S[i] == "C":
            if c_index >= 0:
                return "WA"
            c_index = i
    if c_index == -1:
        return "WA"
    for i in range(1, len(S)):
        if i == c_index:
            continue
        elif S[i].lower() != S[i]:
            return "WA"
    return "AC"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

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

if s[0] == 'A': 
    if 'C' in s[2:-1]:
        for i in range(len(s)):
            if s[i].isupper():
                ss += s[i]
        if ss == 'AC':
            pass
        else:
            ok = False
    else:
        ok = False
else:
    ok = False

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

Solution (Python):
import sys
input = sys.stdin.readline
def main():
    S = input().rstrip()
    L = len(S)
    if S[0] == 'A':
        CNT = 0
        CAP = 0
        for c in range(2,L-1):
            if S[c] == 'C':
                CNT += 1
        for c in S:
            if ord(c) >= 97:
                CAP += 1
        if CNT == 1 and CAP == L-2:
            print('AC')
        else:
            print('WA')
    else:
        print('WA')

if __name__ == '__main__':
    main()

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

Solution (Python):
S = list(input())
ans = 'AC'
if not S[0] == 'A':
    ans = 'WA'
if not 'C' in (S[2:-1]):
    ans = 'WA'
if ans == 'AC':
    S.remove('A')
    S.remove('C')
    if not S == [s.lower() for s in S]:
        ans = ('WA')
print(ans)

Solution (Python):
s=input()
if s[0]!="A":
    print("WA")
else:
    cnt=0
    for i in range(min(2,len(s)-2),max(2,len(s)-2)+1):
        if s[i]=="C":
            cnt+=1
    if cnt!=1:
        print("WA")
    else:
        for i in range(1,len(s)):
            if s[i]!="C":
                if ord("a")>ord(s[i]) or ord("z")<ord(s[i]):
                    print("WA")
                    break
        else:
            print("AC")

Solution (Python):
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    S = list(ns())
    if S[0] == 'A' and 'C' in S[2:-1]:
        S.remove('A')
        S.remove('C')
        for s in S:
            if s.isupper():
                print('WA')
                return
        print('AC')
    else:
        print('WA')


if __name__ == '__main__':
    main()

Solution (Python):
S=input()
count=0
for i in range(2,len(S)-1):
  if S[i]=="C" :
    iC=i
    count+=1
temp=[]
if S[0]=="A" and count==1 :
  for i in range(len(S)):
    if i!=0 and i!=iC :
      temp.append(S[i])
  if (''.join(temp)).islower()==True :
    print("AC")
    exit()
print("WA")

Solution (Python):
s = str(input())
num = 0

if s[0] == "A":
  if "C" in s[2:len(s)-1]:
    for i in s:
      if i.isupper():
        num += 1
    if num == 2:
      print("AC")
      exit(0)
      
print("WA")

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

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

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

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

    print('AC')
    return


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()

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

s = s[1:]

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

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

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

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

sc = s[2:-1]
big = 0

import collections
c = collections.Counter(sc)


if s[0]=="A":
    if c["C"]==1:
        for i in range(ls):
            if s[i].isupper():
                big +=1
        if big ==2:
            print("AC")
            exit()

print("WA")

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

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

Solution (Python):
S = input()

if S[0] == 'A':
    S = S[1:]
    if S[1: -1].count('C') == 1:
        i = S[1: -1].index('C') + 1
        S = S[: i] + S[i + 1:]
        if S.islower():
            print('AC')
            exit()
print('WA')

Solution (Python):
S = input()

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

print('WA')

Solution (Python):
S = list(input().strip())
f = True
if S[0] == "A":
    S[0] = "a"
else:
    S[0] = "X"
if S[2:-1].count("C") == 1:
    S[S.index("C")] = "c"
else:
    S[0] = "X"
if "".join(S) == "".join(S).lower():
    print("AC")
else:
    print("WA")

Solution (Python):
S = input().rstrip()
cnt = 0
for s in S[2:-1]:
    if s == "C":
        cnt += 1
    else:
        if not s.islower():
            print("WA")
            exit()
if cnt == 1 and S[0] == "A" and S[1].islower() and S[-1].islower():
    print("AC")
else:
    print("WA")

Solution (Python):
from collections import Counter

S = input()

def judge(S):
    if S[0] != 'A':
        return False
    elif Counter(S[2:-1])['C'] != 1:
        return False
    elif any(v != 'C' and not v.islower() for v in S[1:]) or not S[1].islower() or not S[-1].islower():
        return False
    return True

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

Solution (Python):
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

s = input()
s_len = len(s)

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

cntc = 0

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

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

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

if s_len-2 != len(s):
    print("WA")
    exit()

for i in range(s_len-2):
    if s[i].isupper():
        print("WA")
        exit()

print("AC")

Solution (Python):
s = input()


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

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

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

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

print("AC")

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

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

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

if S[2:-1].count("C") != 1:
  ans = "WA"
else:
  S.pop(S[2:-1].index("C") + 2)

if not "".join(S[1:]).islower():
  ans = "WA"

print(ans)

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

if 'C' not in S[2:-1]:
  print('WA')
  exit()

s=list(S)
s.remove('A')
s.remove('C')

for x in s:
  if x not in 'abcdefghijklmnopqrstuvwxyz':
    print('WA')
    exit()

print('AC')

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

Solution (Python):
s=input();print('WAAC'['A'==s[0] and s[2:-1].count('C')==1 and (s[1:2]+s[-1:]).islower()::2])

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

Solution (Python):
s=input();print('WAAC'['A'==s[0] and 'C'in s[2:-1] and s.count('C')==1 and s.count('A')==1  and s.replace('A','').replace('C','').islower()::2])

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

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", "")
    S = S.replace("C", "")
    if S == S.lower():
        print('AC')
        quit()
print('WA')

Solution (Python):


S=str(input())
temp=0
j=0
if S[0]!='A':
    print('WA')
    exit()
for i in range(2,len(S)-1):
    if S[i]=='C':
        temp+=1
        j=i
if temp!=1:
    print('WA')
    exit()
for i in range(len(S)):
    if i!=0 and i!=j:
        if S[i].isupper():
            print('WA')
            exit()
print('AC') 
exit()

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()
t=0
if s[0]=="A":
    if(s[2:-1].count("C")==1):
        for i in s:
            if i!="A" and i!="C":
                if i.isupper():
                    t=0
                    break
                else:
                    t=1
if t==0:
    print("WA")
else:
    print("AC")

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

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

S.pop(0)

res = True
c = False

for i in range(len(S)):
    if i == 0 or i == len(S) - 1:
        if not S[i].islower():
            res = False
    
    else:
        if S[i] == "C":
            if not c:
                c = True
            else:
                res = False

        else:
            if not S[i].islower():
                res = False

if res and c:
    print("AC")
else:
    print("WA")

Solution (Python):
s=input()
n=len(s)
if s[0]!="A":
    print("WA")
    exit()
if all(s[i]!="C" for i in range(2,n-1)):
    print("WA")
    exit()
f=0
for i in range(n):
    if s[i]==s[i].upper():
        f+=1
print("AC" if f==2 else "WA")

Solution (Python):
S=input()
if S[0]=="A":
  c=0
  d=0
  for x in range(2,len(S)-1):
    if S[x].islower():
      d+=1
    if S[x]=="C":
      c+=1
  if c==1 and d==len(S)-4 and S[1].islower() and S[len(S)-1].islower():
    print("AC")
  else:
    print("WA")
else:
  print("WA")

Solution (Python):
S = input()
N = len(S)
x = 0
if S[0] == 'A':
    if S[1] == 'C' or S[-1] == 'C':
        print('WA')
    else:
        if S.count('C') == 1:
            S.replace('A', '')
            S.replace('C', '')
            N = len(S)
            for i in range(N):
                if 97 <= ord(S[i]) <= 122:
                    x += 1
            if x == N - 2:
                print('AC')
            else:
                print('WA')
        else:
            print('WA')
else:
    print('WA')

Solution (Python):
s = input()

n = list(s)

check = False
isok = True

if n[0] == 'A':
    check = True

count = 0

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

for i in range(len(n)):
    p = int(ord(n[i]))
    if p == 65 or p == 67 or p > 96:
        continue
    else:
        isok = False

if check and count == 1 and isok:
    print('AC')
else:
    print('WA')

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

Solution (Python):
def main():
    S = str(input())
    cnt = 0
    if S[0] == 'A':
        for i in range(2, len(S)-1):
            if S[i] == 'C':
                cnt += 1
        if cnt == 1:
            for i in range(1, len(S)):
                if S[i] == 'C':
                    continue
                elif S[i].islower():
                    continue
                else:
                    print('WA')
                    return
        else:
            print('WA')
            return
    else:
        print('WA')
        return
    print('AC')
    
main()

Solution (Python):
s = input()

ans = False
if s.startswith('A'):
    if s.count('C') == 1:
        if 2 <= s.find('C') <= len(s) - 2:
            s = s.replace('A', 'a', 1)
            s = s.replace('C', 'c', 1)
            if s.lower() == s:
                ans = True
print('AC' if ans else 'WA')

Solution (Python):


s = str(input())

flag = 1
if s[0] != "A":
    flag = 0


num_C = 0
for i in s[2:-1]:
    if i == "C":
        num_C += 1

for i in s[1:]:
    if i != "C" and i.isupper():
        flag = 0

if num_C != 1:
    flag = 0


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

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

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

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

for i in range(1,len(S)):
  if S[i] != 'C' and (ord(S[i])<97 or ord(S[i])>122):
    print('WA')
    exit()

print('AC')

Solution (Python):
s = input()

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

Solution (Python):
s = input()
counter = 0
for i in range(len(s)):
  if i == 0:
    if s[i] == "A":
      continue
    else:
      print("WA")
      exit()
  else:
    if 2<=i<=len(s)-1:
      if s[1] != s[1].lower():
        print("WA")
        exit()
      if s[i] == "C":
        counter += 1
      else:
        if s[i] != s[i].lower():
          print("WA")
          exit()
    if s[-1] != s[-1].lower():
      print("WA")
      exit()
if counter == 1:
  print("AC")
else:
  print("WA")

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

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


p = 0
s = 0
for i in range(N):
  if i == 0:
    if S[i] != "A":
      p = 1
  elif 2 <= i <= N - 2:
    if S[i] == "C":
      s += 1
    else:
      if alpha2num(S[i]) < 0:
        p = 1
  else:
    if alpha2num(S[i]) < 0:
      p = 1 
      

  
  
if (p == 0) and (s == 1):
  print("AC")
else:
  print("WA")

Solution (Python):
s = input()

wa = False

if s[0] != 'A':
  wa = True
if s[2:-1].count('C') != 1:
  wa = True

l_s = list(s)
  
if 'A' in l_s:
	del l_s[l_s.index('A')]

if 'C' in l_s:
	del l_s[l_s.index('C')]

for c in l_s:
  if c != c.lower():
    wa = True
    
if wa == True:
  print('WA')
else:
  print('AC')

Solution (Python):
s = list(input())
if s[0]=='A':
    s.remove(s[0]);   l = len(s)
    for i in range(l):
        if s[1:l-1].__contains__('C'):
            s.remove('C')
            print('AC' if str(s) == str(s).lower() else 'WA');   break
        else:
            print('WA');   break
else:
    print('WA')

Solution (Python):
s=input()
res="AC"
if s[0]!="A":res="WA"
elif s[2:-1].count("C")!=1:res="WA"
else:
    li=list(s)
    li.remove("A")
    li.remove("C")
    for i in li:
        if i!=i.lower():
            res="WA"
print(res)

Solution (Python):
import re
S = input()
print('AC' if S.startswith('A') and (S[2:-1]).count('C') == 1 and len(re.findall('[A-Z]', S)) == 2 else 'WA')

Solution (Python):
import re

print ('AC' if re.match(r'\AA[a-z]+C[a-z]+\Z', input()) else 'WA')

Solution (Python):
s = input()

a = -1
c = -1
lower = 0
for i in range(len(s)):
  if s[i] == 'A':
    a = i
  if s[i] == 'C':
    c = i
  if 'a' <= s[i] <= 'z':
    lower += 1

if a == 0 and 2 <= c <= len(s) - 2 and lower == len(s) - 2:
  print('AC')
else:
  print('WA')

Solution (Python):
import re

print ('AC' if re.match(r'\AA[a-z](?:[a-z]*C[a-z]*)[a-z]\Z', input()) else 'WA')

Solution (Python):


import math

import itertools
from collections import deque
from collections import Counter
import heapq
from fractions  import gcd


s=input()
c=False
if s[0]=="A":
    for i in range(1,len(s)):
        if s[i]!="C" and s[i].isupper():
            print("WA")
            break
        elif s[i]=="C" :
            if c==False and 2<=i<=len(s)-2:
                c=True

            else:
                print("WA")
                break
    else:
      if  c:
        print("AC")
      else:
        print("WA")
else:
  print("WA")

Solution (Python):
S = input()
sl = []
ans = 'AC'

for i in S:
    sl.append(i)
if S[0] != 'A':
    ans = 'WA'
if S[2:-1].count('C') != 1:
    ans = 'WA'

if S[1:].replace("C","c",1).islower() == False:
    ans = 'WA'

print(ans)

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

Solution (Python):





































































def calculation(lines):
    S = lines[0]
    n_c = 0
    n_l = 0
    for i in range(len(S)):
        if S[i] == 'C':
            n_c += 1
        if S[i] < 'a':
            n_l += 1
    if S[0] != 'A':
        ret = 'WA'
    elif S[1] == 'C':
        ret = 'WA'
    elif S[-1] == 'C':
        ret = 'WA'
    elif n_c != 1:
        ret = 'WA'
    elif n_l != 2:
        
        ret = 'WA'
    else:
        ret = 'AC'
    return [ret]



def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines



def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['AtCoder']
        lines_export = ['AC']
    if pattern == 2:
        lines_input = ['ACoder']
        lines_export = ['WA']
    if pattern == 3:
        lines_input = ['AcycliC']
        lines_export = ['WA']
    if pattern == 4:
        lines_input = ['AtCoCo']
        lines_export = ['WA']
    if pattern == 5:
        lines_input = ['Atcoder']
        lines_export = ['WA']
    return lines_input, lines_export



def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode



def main():
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    
    
    
    
    
    
    
    



if __name__ == '__main__':
    main()

Solution (Python):
s = input()

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

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

s = s.replace('C',"")

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

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

ans = 'AC'
if S[0] != 'A' or 'C' not in S[2:-1]:
    ans = 'WA'

tmp = 0
for i in range(1,N):
    if S[i].isupper():
        tmp += 1

if tmp > 1:
    ans = 'WA'

print(ans)

Solution (Python):
S = input()
answer = 'WA'
if S[0] == 'A':
    sKiridashi = S[2:-1]
    if sKiridashi.count('C') == 1:
        cIndex = sKiridashi.find('C') + 2
        otherStr = S[1:cIndex] + S[cIndex+1:]
        if otherStr.islower():
            answer = 'AC'
print(answer)

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

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

Solution (Python):
from collections import Counter
s = list(input())
n = len(s)
count = Counter(s[2:-1])
lower = [i for i in s if ord('a')<=ord(i)<=ord('z')]

if count.get('C'):
    if count['C']==1 and s[0]=='A' and len(lower)==n-2:
        print('AC')
        exit()
print('WA')

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

Solution (Python):
S = input()
count =0
total =0
if S[0] == 'A':
  count +=1
bbb = S[2:-1]
if bbb.count('C') == 1:
  count +=1
for i in S:
  if i.isupper():
    total +=1
if total ==2:
  count +=1
if count == 3:
  print('AC')
else:
  print('WA')

Solution (Python):
s=input()
ans="AC"
if s[0]!='A' or s[-1]=='C' or s[1]<'a':ans="WA"
else:
    count=0
    for i in range(2,len(s)):
        if s[i]<'a':
            if s[i]=='C':count+=1
            else:count+=2
    if count!=1:ans="WA"
print(ans)

Solution (Python):
S = input()

ans = "WA"

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

print(ans)

Solution (Python):
S = input()




b = True
b = b and (S[0]=='A')
b = b and ( S[2:-1].count('C')==1 )

b = b and ( 'a' <= S[1] <= 'z')
b = b and ( 'a' <= S[-1] <= 'z')

for c in S[3:]:
  b = b and ( ('a' <= c <= 'z') or (c=='C') )

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

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

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

f = False
for i in range(1, len(s)):
    if s[i] == 'C':
        if i < 2 or i >= len(s) - 1:
            print('WA')
            exit(0)
        if f:
            print('WA')
            exit(0)
        f = True
    elif not str.islower(s[i]):
        print('WA')
        exit(0)

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

Solution (Python):
S = input()

ans = "WA"

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

print(ans)

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

S = readline().decode().rstrip()

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

Solution (Python):
s = input()
ans = 'AC'
if s[0] != 'A':
    ans = 'WA'
if not('C' in s[2:-1]):
    ans = 'WA'
s = s.replace('A','')
s = s.replace('C','',1)
for i in s:
    if ord(i) < ord('a') or ord(i) > ord('z'):
        ans = 'WA'
print(ans)

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

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

Solution (Python):
S = input()
if ord(S[0]) != 65:
    print("WA")
    exit()
num = 0
for i in range(2,len(S)-1):
    if S[i] == "C":
        num = i
if not num:
    print("WA")
    exit()
else:
    for j in range(1,len(S)):
        if j != num:
            if 97 <= ord(S[j]) <= 122:
                continue
            else:
                print("WA")
                exit()
print("AC")

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

if S[0] == 'A':
  isC = 0
  for i in S[2:len(S)-1]:
    if i == 'C':
      isC += 1
  else:
    if isC == 1:
      for i in range(len(S)):
        if S[i] == 'A' or S[i] =='C' or S[i].islower():
          pass
        else:
          print('WA')
          break
      else:
        print('AC')
    else:
      print('WA')
else:
  print('WA')

Solution (Python):
S = input()
if S[0] == "A":
    S_cpy = S.lstrip("A")
else:
    print("WA")
    exit()

if S[2:-1].count("C") == 1:
    S_cpy = S_cpy.replace("C", "")
else: 
    print("WA")
    exit()

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

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

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


for i,c in enumerate(s):
    if i != 0 and i!=s[2:-1].index("C")+2:
        if ord(c) <= 90:
            print("WA")
            sys.exit()

print("AC")

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

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

index = -1
between_bigin_3_and_end_2 = s[2:-1]
count = between_bigin_3_and_end_2.count('C')
if count == 1:
    index = s.index('C')
    
else:
    ans = False
    
    

    
for i in range(len(s)):
    if i == 0:
        continue
    if i == index:
        continue
    if not s[i].islower():
        ans = False


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

Solution (Python):
S = list(input()) 
N = len(S)
al=[chr(ord('a') + i) for i in range(26)]

 
flag=0
if S[0]!='A':
    
    flag=1
 
else:
    count=0
    for i in range(2,N-1):
        if S[i]=='C':
            count+=1
 
    
    if count==1:
        for i in range(N):
            if S[i]!='A' and S[i]!='C':
                if S[i] not in al:
                    flag=1
 
    else:
        flag=1
 
if flag==0:
    print('AC')
else:
    print('WA')

Solution (Python):
S = input()

ans = "AC"

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

if S.count("C") != 1:
    ans = "WA"

if not ("C" in S[2:-1]):
    ans = "WA"

for i in range(len(S)):
    if S[i].isupper():
        if S[i] == "A" or S[i] == "C":
            pass
        else:
            ans = "WA"

print(ans)

Solution (Python):
s = open(0).read().rstrip()

import re

if len(s)>3 and re.fullmatch(r'A[a-z]+C[a-z]+',s):
    print('AC')
elif len(s) == 3 and re.fullmatch(r'A[a-z]?C[a-z]?',s):
    print('AC')
else:
    print('WA')

Solution (Python):
import collections
r = raw_input()
print 'AC' if ( r[0] == 'A' and  collections.Counter(r[2:-1])['C'] == 1 and  all([l in set(['A', 'C']) or l.lower() ==l for l in r ])) else 'WA'

Solution (Python):
"""
1. The initial character of S is an uppercase A.
2. There is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).
3. All letters except the A and C mentioned above are lowercase.
"""
import collections
def f(r): return r[0] == 'A' and  collections.Counter(r[2:-1])['C'] == 1 and  all([l in set(['A', 'C']) or l.lower() ==l for l in r ])

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

Solution (Python):
"""
1. The initial character of S is an uppercase A.
2. There is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).
3. All letters except the A and C mentioned above are lowercase.
"""
import collections
def a(r): return r[0] == 'A'
def b(r): return collections.Counter(r[2:-1])['C'] == 1
def c(r): return all([l in set(['A', 'C']) or l.lower() ==l for l in r ])
def f(r):  return a(r) and b(r) and c(r)

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

Solution (Python):
s = list(input())
flag = 1
if s[0] == "A" :
    if s[2:-1].count("C") == 1 :
        for i in range(1,len(s)) :
            if i != s[2:-1].index("C") + 2 :
                if s[i] != s[i].lower() :
                    flag = 0
                    break
    else :
        flag = 0
else :
    flag = 0

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

Solution (Python):
def main():
    S = input().rstrip()
    if S[0] != "A":
        print("WA")
        exit()
    if S[2:-1].count("C") != 1:
        print("WA")
        exit()
    chars = [chr(i) for i in range(97, 97+26)]
    for s in S[1:]:
        if s == "C":
            continue
        elif s not in chars:
            print("WA")
            exit()
    print("AC")


if __name__ == '__main__':
    main()