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.



Sample input:
AtCoder


Sample output:
AC

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())
def C(s):
    if s[0]!='A':
        return False
    if 'C' in s:
        i=s.index('C')
        if 2<=i<=len(s)-2:
            k=s.pop(i)
            l=s.pop(0)
            if ''.join(s).islower():
                return True
            
    return False
if (C(s)):
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
import re

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

def func(s):
    if s[0] == 'A':
        if s[2:-1].count('C') == 1:
            s_ = s[2:-1].replace('C', '')
            ss = s[1] + s_ + s[-1]
            return ss.islower()
        else:
            return False
    else:
        return False

if func(S):
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
def solve():
    S = input()
    if S[0] != 'A':
        return False
    if S[2:-1].count('C') != 1:
        return False
    n = len(list(filter(lambda c:'a' <= c and c <= 'z', S)))
    if n != len(S) - 2:
        return False
    return True

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

Submission status: Accepted

Solution code:
S = input()
flg = True
if 'C' in S[2:len(S) - 1]:
    i = S.index('C')
else:
    i = -1

if S[0] == 'A' and i != -1:
    others = S[1:i] + S[i + 1:]
    for o in others:
        if not (ord('a') <= ord(o) <= ord('z')):
            flg = False
            break
else:
    flg = False

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

Submission status: Accepted

Solution code:
# /user/bin/python
# -*- coding: utf-8 -*-
import sys
import numpy as np


def solve(s):
  if s[0] != 'A':
    return False
  if s[2:-1].count('C') != 1:
    return False
  s = s[1:]
  s = s[:-1].replace("C", "") + s[-1]
  for c in s:
    if c not in 'abcdefghijklmnopqrstuvwxyz':
      return False
  return True

s = str(input())
if solve(s):
  print('AC')
else:
  print('WA')

Submission status: Accepted

Solution code:
S = input()
count_C = 0
index_C = 0
if S[0] == 'A':
  for i in range(2,len(S)-1):
    if S[i] == 'C':
      count_C+=1
      index_C = i
  if count_C == 1:
    s = S[1:index_C]+S[index_C+1:]
    if s.islower():
      print('AC')
    else:
      print('WA') 
  else:
    print('WA') 
else:
  print('WA')

Submission status: Accepted

Solution code:
s = input()
ans = "AC"

if s[0] != 'A':
    ans = "WA"
if s[2:-1].count('C') != 1:
    ans = "WA"
cnt = 0
for c in s[1:]:
    if c.isupper():
        cnt += 1
if cnt != 1:
    ans = "WA"
print(ans)

Submission status: Accepted

Solution code:
s = list(input())
c = 0
if s[0] != "A":
    print("WA")
    
else:
    for a in s[2:-1]:
        if a == "C":
            c += 1
            t = a
    if c == 1:
        s.remove(s[0])
        s.remove(t)
        if "".join(s).islower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")

Submission status: Accepted

Solution code:
S = [i for i in input()]
if S[0]=="A" and S[2:-1].count("C")==1:
    S.remove("A")
    S.remove("C")
    if "".join(S).islower():
            print("AC")
    else:
        print("WA")
else: 
    print("WA")

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc104/tasks/abc104_b
s = input()
if s[0] != "A":
    print("WA")
    exit()
if (s[2:len(s) - 1].count("C") != 1):
    print("WA")
    exit()
if (len(s) - len([b for b in s if b.islower()]) != 2):
    print("WA")
    exit()
print("AC")

Submission status: Accepted

Solution code:
S = input()
if S[0]!='A':
  print('WA')
else:
  i = 2
  count = 0
  while i < len(S)-1:
  	if S[i] == 'C':
      		count += 1
  	i += 1
  if count != 1:
    print('WA')
  else:
    S = S.replace('A','').replace('C','')
    if S.islower() == False:
      print('WA')
    else:
      print('AC')

Submission status: Accepted

Solution code:
import collections
s=list(map(str,input()))
if s[0]=="A":
    c=collections.Counter(s[2:-1])
    if c["C"]==1:
        s.remove("A")
        s.remove("C")
        s=map(str,s)
        s="".join(s)
        if s.islower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def islow(a):
    if 97 <= ord(a) < 123:
        return 1
    return 0

s = input()
t = 0
if s[0] == "A":
    t += 1
for i in range(1, len(s)):
    if 2<=i<=len(s)-2 and s[i] == "C":
        t += 10
    elif not islow(s[i]):
        t += 100
    
print("AC" if t == 11 else "WA")

Submission status: Accepted

Solution code:
s=input()
if s[0]=="A" and "C"in s[2:-1]:
    p=s.index("C")
    v=s[1:p]+s[p+1:]
    if v.islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
sml = list("qwertyuiopasdfghjklzxcvbnm")
big = list("QWERTYUIOPASDFGHJKLZXCVBNM")

s = list(input())

if s[0] != "A" or s[1] in big or s[-1] in big:
  print("WA")
else:
  bigc = s[2:-1]
  cnt_c = 0
  cnt_big = 0
  for item in bigc:
    if item == "C":
      cnt_c += 1
    elif item in big:
      cnt_big += 1
  if cnt_c == 1 and cnt_big == 0:
    print("AC")
  else:
    print("WA")

Submission status: Accepted

Solution code:
S = input()

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

print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
judge = True
alphabet_1 = "ABCDEFGHIJKMLNOPQRSTUVWXYZ"
alphabet_2 = "ABDEFGHIJKMLNOPQRSTUVWXYZ"
count = 0
if s[0] != "A":
    judge = False
for i in range(1,len(s)):
    if i >1 and i<=len(s)-2:
        if s[i] == "C" : count+=1
        for j in alphabet_2:
            if j == s[i] : 
                judge=False
                break
    else:
        for j in alphabet_1:
            if j == s[i]:
                judge=False
                break
if count !=1 : judge = False
print("AC") if judge else print("WA")

Submission status: Accepted

Solution code:
#ABC097B
hoge=input()
no=0

if(hoge[0]=="A"):
    hoge=hoge.replace("A","a",1)
else:
    no=1
    
if not(hoge[1].islower() and hoge[-1].islower()):
    no=1

if(hoge.count("C")==1):
    hoge=hoge.replace("C","c",1)
else:
    no=1
    
if(hoge.islower() and no==0):
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
S = input()
flag1 = 0
flag2 = 0
flag3 = 0

if not ('A' in S and 'C' in S):
	print('WA')
	exit() 

if S[0] == 'A':
	flag1 = 1

C_num = 0
for i in range(len(S[2:-1])):
	if S[2+i] == 'C':
		C_num = C_num + 1 
if C_num == 1:
	flag2 = 1

S_list = list(S)
S_list.remove('A')
S_list.remove('C')
if str(S_list).islower():
	flag3 = 1

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

Submission status: Accepted

Solution code:
def main():
    s = input()
    ans = "AC"
    # 条件1
    if s[0] != "A":
        ans = "WA"
    # 条件2,3
    cnt = 0
    for i in range(1, len(s)):
        if s[i].isupper():
            if i == 1 or i == len(s)-1 or s[i] != "C":
                ans = "WA"
            cnt += 1
    if cnt != 1:
        ans = "WA"

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = input()
c = 0
for i, n in enumerate(N):
    if i == 0:
        if not n == "A":
            print("WA")
            exit()
    elif n == 'C':
        if 2<= i and i < len(N) -1:
            c += 1
    else:
        if not 97 <= ord(n) or not ord(n) <= 122:
            print("WA")
            exit()
if c == 1:
    print("AC")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

S = str(input())
answer = 'WA'

if S[0] == 'A':
	if S.count('C') == 1:
		if 1< S.find('C') < len(S)-1:
			if len(re.findall('[A-Z]',S)) ==2:
				answer = 'AC'
				
print(answer)

Submission status: Accepted

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

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

for i in range(n):
    if s[i] == "C":
        s1 = s[1:i] + s[i+1:]

if s1.islower():
    print("AC")
else:
    print("WA")
    exit()

Submission status: Accepted

Solution code:
s=input()
import re
if (s[0] == 'A') and ('C' in s[2:-1]) and (re.sub('A|C','',s,2) == re.sub('A|C','',s,2).lower()):
  print('AC')
else:
  print('WA')

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc104/tasks/abc104_b


def main():
    S = input()
    if S[0] == "A" and S[2:-1].count("C") == 1:
        S = S.replace('A', '', 1).replace('C', '', 1)
        if all(c.islower() for c in S):
            print("AC")
            exit()

    print("WA")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 12 15:50:41 2019

@author: shinjisu
"""


import math


def getInt(): return int(input())


def getIntList(): return [int(x) for x in input().split()]


def zeros(n): return [0]*n


def getIntLines(n): return [int(input()) for i in range(n)]


def getIntMat(n):
    mat = []
    for i in range(n):
        mat.append(getIntList())
    return mat


def dmp(x):
    global debug
    if debug:
        print(x)
    return x


# ABC 100 B Ringo's Favorite Numbers
def abc100b():
    D, N = getIntList()
    if N % 100 == 0:
        return (N+1) * 100**D  # WA N==100のとき正しくない 101*100**D
    else:
        return N * 100**D


# ABC 101 B digit sum
def abc101b():
    N = getInt()
    sm = 0
    n = N
    while n > 0:
        sm += n % 10
        n //= 10
    if N % sm == 0:
        return 'Yes'
    else:
        return 'No'


# ABC 102 B Maximum Difference
def abc102b():
    N = getInt()
    A = getIntList()
    return max(A) - min(A)


# ABC 104 B AcCepted
def abc104b():
    S = input()
    WA = 'WA'
    AC = 'AC'
    ALPHABET = [chr(i+ord('a')) for i in range(26)]
    dmp(ALPHABET)

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

    cFound = False
    for i in range(1, len(S)):
        if S[i] in ALPHABET:
            pass
        elif S[i] == 'C':
            if i >= 2 and i <= len(S)-2 and not cFound:
                cFound = True
            else:
                dmp(('C',WA))
                return WA
        else:
            dmp(('alpha',WA))
            return WA
    else:
        if cFound:
            return AC
        else:
            return WA


debug = False  # True False
print(abc104b())

Submission status: Accepted

Solution code:
S=str(input())
slist=list(S)
flag=0
if slist[0]!="A":
  flag=1
klist=slist[2:-1]
c=klist.count("C")
if c!=1:
  flag=1
del slist[0]
if "C" in slist:
  slist.remove("C")
SS=""
for x in slist:
  SS+=x
if SS.islower():
  pass
else:
  flag=1
if flag==0:
  print("AC")
else:
  print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
if s[0] != "A":
    print("WA")
    exit()
if s[1].isupper():
    print("WA")
    exit()
if s[-1].isupper() or s[-1] == "C":
    print("WA")
    exit()
flag = False
for c in s[2:]:
    if c == "C":
        if flag:
            print("WA")
            exit()
        else:
            flag = True
    else:
        if c.isupper():
            print("WA")
            exit()
if flag:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
S = input()

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

print('WA')

Submission status: Accepted

Solution code:
import re


def main() -> None:
    print("AC" if re.search("^A[a-z]+C([a-z]*)[a-z]$", input()) else "WA")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import re


def main() -> None:
    S = input()
    if re.search("^A[a-z]+C([a-z]*)[a-z]$", S):
        print("AC")
    else:
        print("WA")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
s = list(input())
 
if s[0] != 'A':
    print('WA')
    sys.exit(0)

for i in range(2, len(s) - 1):
    if s[i] == 'C':
        s.pop(i)
        break
else:
    print('WA')
    sys.exit(0)
 
if ''.join(s[1:]) == ''.join(s[1:]).lower():
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = input()
if S[0] != "A":
    print("WA")
    exit()
if S[2:-1].count("C") != 1:
    print("WA")
    exit()
c = S[2:-1].index("C") + 2
for i, s in enumerate(S):
    if i == 0 or i == c:
        continue
    if s.isupper():
        print("WA")
        exit()
print("AC")

Submission status: Accepted

Solution code:
s = input()

torf = True


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


if s[2:-1].count("C") != 1:
    torf = False

cindex = s[2:-1].find("C") + 2

slist = list(s)

slist.pop(cindex)
slist.pop(0)

s1 = "".join(slist)
if s1.islower() != True:
    torf = False

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

Submission status: Accepted

Solution code:
import sys

def main():
  input = sys.stdin.readline
  S = str(input())
  ans = 'WA'
  if S[0] == 'A':
    if 'C' in S[2:-2]:
      S = S.replace('A', '', 1)
      S = S.replace('C', '', 1)
      if S.islower():
        ans = 'AC'
        
  print(ans)


if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
s = input()

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

if s[1].isupper():
    print('WA')
    exit()

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

if cnt != 1:
    print('WA')
    exit()
index = 0
for i in range(2, len(s) - 1):
    if s[i] == 'C':
        index = i
        break
# print(index)

test = s[2:index] + s[index + 1:len(s)]
# print(test)

if test.islower():
    print('AC')
else:
    print('WA')
exit()

if index != 2 and index + 1 != len(s) - 1:
    if s[2:index].islower() and s[index + 1:len(s) - 1].islower():
        print('AC')
    else:
        print('WA')

elif index == 2:
    if s[index + 1:len(s) - 1].islower():
        print('AC')
    else:
        print('WA')
else:
    if s[2:index].islower():
        print('AC')
    else:
        print('WA')

Submission status: Accepted

Solution code:
str_s = input()

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

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

idx_c = str_s.find("C")

w_str = str_s[1:idx_c] + str_s[idx_c +1:]
if w_str.islower():
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
S = input()
ans = 'AC' if S[0] == 'A' and S[2:-1].count('C') == 1 and sum(s.isupper() for s in S) == 2 else 'WA'
print(ans)

Submission status: Accepted

Solution code:
S = input()
T = S.replace("A","").replace("C","")

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

Submission status: Accepted

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

    
    if count==1:
        x=s[1:index]+s[index+1:]
        if x.islower():
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
            
else:
    print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

flg = True

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

cnt = 0

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

if cnt != 1:
    flg = False

cnt = 0

for i in range(len(S)):
    if 'A' <= S[i] <= 'Z':
        cnt += 1

if cnt != 2:
    flg = False

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

Submission status: Accepted

Solution code:
s = str(input())
l = 'qwertyuiopasdfghjklzxcvbnmAC'
if s[0]=="A":
    s_ = s[2:-1]
    c=0
    for w in s_:
        if w=='C':
            c+=1
    if c==1:
        for i in range(len(s)):
            if not s[i] in l:
                break
            if i==len(s)-1:
                print('AC')
                import sys
                sys.exit()
print('WA')

Submission status: Accepted

Solution code:
# B
s = str(input())
ans = 'WA'
c_list = [c  for c in s]
if s[0] == 'A':
    if s[2:-1].count('C') == 1:
        c_list.remove('A')
        c_list.remove('C')
        if all((ord('a') <= ord(x) <= ord('z') for x in c_list)):   
            ans = 'AC'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
count=0
for i in range(len(s)):
    if i==0:
        if s[i] != "A":
            print("WA")
            exit()
    elif s[i] == "A":
        if i!=0:
            print("WA")
            exit()
    elif s[i] == "C":
        if 2<=i<=len(s)-2:
            count += 1
            if count >= 2:
                print("WA")
                exit()
        else:
            print("WA")
            exit()
    else:
        if not s[i].islower():
            print("WA")
            exit()
print('AC') if count==1 else print('WA')

Submission status: Accepted

Solution code:
S=input()
hoge=S[2:-1]
result=False
if S[0]=="A":
    if "C" in hoge:
        a=S[1:hoge.find("C")+2]+S[hoge.find("C")+3:]
        if a==a.lower():
            result=True
if result==True:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()
f1 = s[0] == "A"
f2 = s[2:-1].count("C") == 1
index = s[2:-1].find("C") + 2
f3 = (s[1:index]+s[index+1:]).lower() == (s[1:index]+s[index+1:])
print("AC" if f1 and f2 and f3 else "WA")

Submission status: Accepted

Solution code:
s = input()

ans = "WA"
if s[0] == "A" and s[2:-1].count("C") == 1 and s[1] != "C" and s[-1] != "C":
    s2 = s.replace("A","a").replace("C","c")
    if s2 == s.lower():
        ans = "AC"

print(ans)

Submission status: Accepted

Solution code:
from collections import Counter

class Solver(object):
    def __init__(self):
        self.s = input()

    def solve(self):
        if self.s[0].upper() != "A":
            print("WA")
            return

        counter = Counter(self.s)
        subset_counter = Counter(self.s[2:-1])

        if counter['A'] != 1:
            print("WA")
            return

        if subset_counter['C'] != 1:
            print("WA")
            return
        
        counter.pop('A')
        counter.pop('C')

        for char in counter:
            if char != char.lower():
                print("WA")
                return

        print("AC")

if __name__ == "__main__":
    s = Solver()
    s.solve()

Submission status: Accepted

Solution code:
s = input()

ans = "WA"
if s[0] == 'A' and s[2:-1].count('C') == 1 and s[1] != 'C' and s[-1] != 'C':
    s2 = s.replace('A', 'a').replace('C', 'c')
    if s2 == s.lower():
        ans = "AC"
print(ans)

Submission status: Accepted

Solution code:
S = input()
ans = "WA"
if(S[0] == 'A'):
  if('C' in S[2:-1]):
    if(S[1:S.index('C')].islower() and S[S.index('C')+1:].islower()):
      ans = "AC"
print(ans)

Submission status: Accepted

Solution code:
s=input()

x=[];
Ccount=0

while(1):

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

    s=s.strip("A")

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

    if Ccount!=1:
        print('WA')
        break

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

    if s.islower()==0:
        print('WA')
        break

    print('AC')
    break

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(str(input()))
count = 0
uppercount = 0

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

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

Submission status: Accepted

Solution code:
s = list(str(input()))
count = 0
uppercount = 0
for i in range(len(s)):
    if s[i] == "C":
            count += 1
for c in s:
    if c.isupper():
        uppercount += 1

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

Submission status: Accepted

Solution code:
alph = 'abcdefghijklmnopqrstuvwxyz'

s = input()
if s[0] == 'A' and s[1] in alph and s[-1] in alph:
    c = 0
    cnt = 0
    for i in range(2,len(s)-1):
        if s[i] == 'C':
            c += 1
        else:
            if s[i] in alph:
                cnt += 1
                
    if c == 1 and cnt == len(s)-4:
        print('AC')
        exit()

print('WA')

Submission status: Accepted

Solution code:
s = input()
s_prime = ""
if s[0] != "A":
    # print(1)
    print("WA")
else:
    s_prime = s[1:]
    if s[2:-1].count("C") != 1:
        # print(2)
        print("WA")
    else:
        s_prime = s_prime.replace("C","")
        # print(s_prime)
        if s_prime.islower():
            # print(3)
            print("AC")
        else:
            # print(4)
            print("WA")

Submission status: Accepted

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

if s[0] != 'A':
    ans = 'WA'
if s[2:-1].count('C') != 1:
    ans = 'WA'
if s[1] == 'C' or s[-1] == 'C':
    ans = 'WA'
reps = s.replace('A', 'a').replace('C', 'c')    
if reps != s.lower():
    ans = 'WA'

print(ans)

Submission status: Accepted

Solution code:
import sys
S = input()

if S[0] == "A":
    if S[2:-1].count("C") == 1 and S[1] != "C" and S[-1] != "C":
        S_A = S.replace("A", "", 1)
        S_AC = S_A.replace("C", "")
        if S_AC.islower() == True:
            print("AC")
            sys.exit()


print("WA")

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import sys
import math
import fractions

def j(q):
    if q==1: print("AC")
    else:print("WA")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())

#n = ip()                              #入力整数1つ
#n,k= (int(i) for i in input().split())      #入力整数横2つ
#x,y,z = (int(i) for i in input().split())    #入力整数横3つ
#n,m,x,y= (int(i) for i in input().split())  #入力整数横4つ
#a = [int(i) for i in input().split()]        #入力整数配列
a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列

#jの変数はしようできないので注意
#xor は(a ^ b)でいける

if a[0] != 'A':j(0)
b = a[2:len(a)-1]
if b.count('C') != 1:j(0)
if a[len(a)-1] == 'C':j(0)
b = a[1:]
for i in range(1,len(a)):
    p = a[i].lower()
    if not (p == a[i] or a[i]=='C'):
        j(0)
j(1)

Submission status: Accepted

Solution code:
S = input()

if(S[0] == "A"):
  if("C" in S[2:-1]):
    if(S[1:S.index("C")].islower() and S[S.index("C")+1:].islower()):
      print("AC")
      exit()
print("WA")

Submission status: Accepted

Solution code:
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = map(int,input().split())|	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = list(map(int,input().split()))	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]

import collections
def inpl(): return list(map(int, input().split()))

#### START
S = input()

flag = True
if S[0] != "A":
  flag = False
if S[2:-1].count("C") != 1:
  flag = False
if sum([s.islower() for s in S]) != len(S)-2:
  flag = False

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

Submission status: Accepted

Solution code:
s=input()
if s[0]!="A":
  print("WA")
  exit()
s=s[1:]
count_C=0
for i in range(len(s)-2):
  if s[i+1]=="C":
    count_C+=1
if count_C!=1:
  print("WA")
  exit()
s=s.replace("C","")
if not s.islower():
  print("WA")
  exit()
print("AC")

Submission status: Accepted

Solution code:
alpha = [str(chr(i)) for i in range(97,97+26)]

def main():
    S = list(raw_input())
    if S[0] != 'A':
        return 'WA'
    S.remove('A')
    flag = True
    for i in S[1:-1]:
        if i == 'C':
            flag = False
            S.remove('C')
            break;
    if flag:
        return 'WA'
    for i in S:
        if i not in alpha:
            return 'WA'
    return 'AC'

print main()

Submission status: Accepted

Solution code:
S = input()

ans = 'AC'

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

S = list(S)
if S.count('C')>0:
    S.remove('C')

if (''.join(S[1:])).islower() == False:
    ans = 'WA'

print(ans)

Submission status: Accepted

Solution code:
s = input()
l = s[2:len(s)-1]
for i in s:
    if i not in "abcdefghijklmnopqrstuvwxyzAC":
        print("WA")
        exit()
else:
    if s[0]=="A" and l.count("C")==1:
        print("AC")
    else:
        print("WA")

Submission status: Accepted

Solution code:
S=input()
ok=False
if S[0]=='A'and 'C'in S[2:-1]:
    a=S.index("C")
    if S[1:a].islower()and S[a+1::].islower():
        ok=True
print('AC'if ok else 'WA')

Submission status: Accepted

Solution code:
s = list(map(str,input()))
ans = 0
if s[0] == "A":
    ans += 1
S = (s[2:-1])
c = 0
cp = 0
for i in range(len(S)):
    if S[i] == "C":
        c += 1
        cp = i
if c == 1:
    ans += 1
isl = 0
for i in range(len(s)):
    if i == 0 or i == cp+2:
        pass
    else :
        if s[i].islower():
            isl += 1
if isl == len(s)-2:
    ans += 1
if ans == 3:
    print("AC")
else :
    print("WA")

Submission status: Accepted

Solution code:
S=input()
if(S[0]=='A'):
  S_1=S[1:]
else:
  print('WA')
  exit()
if(S[2:(len(S)-1)].count('C')==1):
  S_2=S_1[0:len(S_1)-1].replace('C','')
else:
  print('WA')
  exit()
S_3=S_2+S[-1]
#print(S_1)
#print(S_2)
#print(S_3)
print('AC' if (S_3.islower()) else 'WA')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
ss=[]
if(s[0]=='A'):
    if('C' in s[2:-1]):
        a=s.find('A')
        b=s.find('C')
        if(s[a+1:b].islower() and s[b+1:].islower()):
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

Solution code:
s=list(input())
ans='AC'
if s[0]!='A':
    ans='WA'
if s[1]=='C':
    ans='WA'
t=s[2:-1]
if t.count('C')!=1:
    ans='WA'
u=list(set(s)-{'A','C'})
for i in range(len(u)):
    if u[i].isupper():
        ans='WA'
print(ans)

Submission status: Accepted

Solution code:
s = list(input())
if s[2:-1] .count('C')==1 and s[0]=='A':
  tmp = s.index('C')
  s.pop(tmp)
  s.pop(0)
  a = str(''.join(s))
  if a.islower()==True:
    print('AC')
    exit()  
print('WA')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys

S = input()
if S[0] != 'A':
    print('WA')
    sys.exit(0)
for l in S:
    if l in list('BDEFGHIJKLMNOPQRSTUVWXYZ'):
        print('WA')
        sys.exit(0)

re = len(list(filter( lambda x: x == 'C', S[2:-1])))
if re == 1:
    print('AC')
else:
    print('WA')