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 sum([c.isupper() for c in S]) == 2:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = input()
state = False
if s.startswith('A'):
    if s[2:-1].count('C') == 1:
        if s.lstrip('A').replace('C', 'c') == s.lstrip('A').replace('C', 'c').lower():
            state = True

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

Submission status: Accepted

Solution code:
n = input()
Flag = False

if n[0] == "A": 
    n = n[1:]
    if n[1:-1].count("C") == 1:
        n = n.replace("C","")
        if n == n.lower():
            Flag = True
if Flag:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
S=str(input())
output='WA'
if S[0]=='A':
    S=S.replace('A','a',1)
    if S[2:-1].count('C')==1:
        S=S.replace('C','c',1)
        if S.islower():
            output='AC'
print(output)

Submission status: Accepted

Solution code:
s = input()
wa = 0
if s[0] == 'A':
    s = s[1:]
else:
    wa = 1

for i in range(len(s)):
    if i in [0,len(s)-1]:
        continue
    if s[i] == 'C':
        s = s[:i]+s[i+1:]
        break
else:
    wa = 1

if not s.islower():
    wa = 1

if bool(wa):
    print('WA')
else:
    print('AC')

Submission status: Accepted

Solution code:
#104b
s=input()
s_l=s.lower()
sa=s[:2]
sc=s[2:-1]
flag=False

if s[0]=='A' and sc.count('C')==1 :
    sc=sc.replace('C','c')
    sa=sa.replace('A','a')
    if s_l==sa+sc+s[-1]:
        flag=True

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

S = input()
def judge_S(S):
    sliced_S = S[2:-1]
    if S[0] != "A":
        return "WA"
    else:
        S = S[1:]
    if sliced_S.count("C") != 1:
        return "WA"
    else:
        S = S.replace("C", "")
    if not S.islower():
        return "WA"

    return "AC"


print(judge_S(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

flag = False

if S[0] == 'A':
    S = S.strip('A')
    if S[1:-1].count('C') == 1:    # countメソッド
        S = S.replace('C', '')
        if S == S.lower():
            flag = True

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

Submission status: Accepted

Solution code:
s = raw_input()
a = (s[0] == 'A')
c = False
cx = -1
for i in range(2, len(s)-1):
	if s[i] == 'C':
		c = True
		cx = i
		break
other = True
for i in range(1, len(s)):
	if i != cx:
		if 65 <= ord(s[i]) and ord(s[i]) <= 90:
			other = False
status = 'WA'
if a and c and other: status = 'AC'
print status

Submission status: Accepted

Solution code:
def solution(s):
    #todo: check if s is valid
    if s[0] == 'A' and sum([1 for c in s if c =='C']) == 1 and sum([1 for c in s[2:-1] if c =='C']) == 1 and sum([1 for c in s if ord(c) <= ord('Z')]) == 2:
        return 'AC'
    return 'WA'

def main():
    s = raw_input().strip()
    print solution(s)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
t=list(input())

if t[0]=="A" and not t[1]=="C" and not t[-1]=="C":
    rs=1
else:
    rs=0

if t[1].isupper()==True or t[-1].isupper()==True:
    rs -=1

del t[:2]
del t[-1]

if not t.count("C")==1:
    rs -=1

if rs==1:
    t.remove("C")

for i in t:
    if i.isupper()==True:
        rs -=1

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
	
def isSmall(c):
	return ord(c)>= ord('a') and ord(c)<=ord('z')

# 文字列の入力
s = raw_input()
sl=list(s)

if sl[0]=='A' and sl[2:-1].count('C')==1 and len([c for c in sl if not isSmall(c)] )==2:
	print 'AC'
else:
	print 'WA'

Submission status: Accepted

Solution code:
s=raw_input()
if s[0]=="A" and len(s)>=3 and s.count("C")==1 and s[-1]!="C" and s[1]!="C" and all(x not in s[1:] for x  in"ABDEFGHIJKLMNOPQRSTUVWXYZ"):print "AC"
else:print "WA"

Submission status: Accepted

Solution code:
import re

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

Submission status: Accepted

Solution code:
S=input()

if S[0]=='A' :
    if 'C' in S[2:-1]:
        if S.count('C')==1:
            bl = True
            for s in S[1:]:
                if s<'a' and s !='C':
                    bl = False
            if bl:
                print('AC')
                exit(0)                
print('WA')

Submission status: Accepted

Solution code:
S=input()

if S[0]=='A' :
    if 'C' in S[2:-1]:
        if S.count('C')==1:
            bl = True
            for s in S:
                if s<'a' and s !='A' and s !='C':
                    bl = False
            if bl:
                print('AC')
                exit(0)                
print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
s = input("")

count_c = 0

if(s[0] == "A"):
    for i in range(1, len(s)):

        if(s[i]=="C" and i >= 2 and i <= len(s)-2):
            count_c += 1
        elif(s[i].isupper()):
            print("WA")
            sys.exit()
            
        
    if(count_c != 1):
        print("WA")
    else:
        print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
def m():
    s = str(input())
    if s[0] != "A":
        return "WA"
    if s[2:len(s)-1].count("C") != 1:
        return "WA"
    for c in s[1:]:
        if c == "C":
            continue
        if c.isupper():
            return "WA"
    return "AC"


print(m())

Submission status: Accepted

Solution code:
def checker():
    s = input()
    if s[0] != "A":
        return 0
    if s[2:-1].count("C") != 1:
        return 0
    num = s.index("C")
    s = s[1:num] + s[num+1:]
    if s != s.lower():
        return 0
    return 1

l = ["WA", "AC"]

print(l[checker()])

Submission status: Accepted

Solution code:
s = input()
S = list(s)

count = 0
check = 0

if S[0] == 'A':
    for i in range(len(S)-3):
        if S[i+2] == 'C':
            count += 1
    if count == 1:
        for j in range(len(S)-1):
            if S[j+1].islower() == False:
                check += 1
        if check == 1:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
# encoding: utf-8
S = input()

state = ""

for i, char in enumerate(S):
    # print(char,state)
    # error path
    if state == "":
        if char == "A": state = "A"
        else: state = "WA"
    elif state == "A":
        if char == "C" and i < 2: state = "WA"
        elif char == "C": state = "C"
        elif char.isupper(): state = "WA"
        else: continue
    elif state == "C":
        if char == "C": state = "WA"
        elif char.isupper(): state = "WA"
        else: state = "AC"
    else: # AC
        if char.isupper(): state = "WA"
    
else:
    if state == "AC": print("AC")
    else: print("WA")

Submission status: Accepted

Solution code:
S = raw_input()
c1 = S[0] == 'A'
count, pos = 0, -1
for i in range(2, len(S)-1):
	if S[i] == "C":
		count += 1
		pos = i
c2 = count == 1

c3 = True
for i in range(len(S)):
	if i == 0 or i == pos:
		continue
	if S[i].isupper():
		c3 = False


if c1 and c2 and c3:
	print 'AC'
else:
	print 'WA'

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

S = input()

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

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

if re.match(r'A[a-z]+C[a-z]+\Z', S) == None:
  print('WA')
  exit()

print('AC')

Submission status: Accepted

Solution code:
s=input()
l=len(s)
j=0
k=0

if s[0]=="A":
    for i in range(2,l-1):
        if s[i]=="C":
            j=i
            k+=1

if k==1:
    if s[1:j].islower() and s[j+1:l].islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
def ok(s):
    n = len(s)
    return (s[0] == "A") and \
        len(filter(lambda _: _=="C", s[2:n-1])) == 1 and \
        len(filter(lambda _: _.islower(), s)) == n-2

def solve(s):
    return "AC" if ok(s) else "WA"

assert solve("AtCoder") == "AC"
assert solve("ACoder") == "WA"
assert solve("AcycliC") == "WA"
assert solve("AtCoCo") == "WA"
assert solve("Atcoder") == "WA"
s = raw_input()
print solve(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
Ccount = 0
j = 0
hantei = False

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

if S[0] == "A":
    char_S = list(S)
    del char_S[j]
    del char_S[0]
    S = "".join(char_S)
    hantei = True

if (Ccount == 1) and (S.islower()) and hantei:
    print("AC")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re;print(re.match("A[a-z]+C[a-z]+$",input())and"AC"or"WA")

Submission status: Accepted

Solution code:
import re
print(re.match("A[a-z]+C[a-z]+$",input())and"AC"or"WA")

Submission status: Accepted

Solution code:
import re
print(re.match(r"A[a-z]+C[a-z]+$",input())and"AC"or"WA")

Submission status: Accepted

Solution code:
s=input()
d=1
if not s[0]=='A':
    d=0
l=len(s)
t=0
for i in range(2,l-1):
    if s[i]=='C':
        t+=1
if not t==1:
    d=0
u=0
for i in range (l):
    if s[i]>='A' and s[i]<='Z':
        u+=1
if not u==2:
    d=0
if d:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = input()
if S[0] != 'A':
    print('WA')
elif S.count('C') != 1:
    print('WA')
elif 'C' not in S[2:-1]:
    print('WA')
else:
    upper = 0
    for c in S:
        if c.isupper():
            upper += 1
    print('AC' if upper == 2 else '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 i == len(S) - 1 or S[i] != 'C':
            ans = "WA"
        cnt += 1

if cnt != 1:
    ans = "WA"
    
print(ans)

Submission status: Accepted

Solution code:
s = input()

ans = 1
if not s[0] == "A":
    ans = 0

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

if not count == 1:
    ans = 0

group = set([chr(i) for i in range(97, 97+26)])

num = 0
for i in range(len(s)):
    if s[i] in group:
        num += 1

if not num == len(s) - 2:
    ans = 0

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

Submission status: Accepted

Solution code:
from sys import stdin

S = stdin.readline().rstrip()

cond1 = S[0] == 'A'
cond2 = S.count('C', 2, -1) == 1
cond3 = S.replace('A', '').replace('C', '').islower()

if cond1 and cond2 and cond3:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = input()
l = len(S)
cnt = 0
cnt2 = 0
for i in range(l):
	if (S[i] != 'A' and i == 0):
		print("WA")
		exit(0)

	if (2 <= i and i < l-1 and S[i] == 'C'):
		cnt += 1

	if S[i].isupper():
		cnt2 += 1


if (cnt != 1 or cnt2 != 2):
	print("WA")
	exit(0)

print("AC")

Submission status: Accepted

Solution code:
s = input()
flag = True
if s[0] == "A":
  s2 = s[2:-1]
  if s2.count('C') == 1:
    for i in range(len(s)):
      if i == 0 or i == s.index('C'):
        continue
      else:
        if s[i].lower() != s[i]:
          flag = False
          break
  else:
    flag = False
else:
  flag = False

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

Submission status: Accepted

Solution code:
S = input()

lowStr = "abcdefghijklmnopqrstuvwxyz"
uppStr = lowStr.upper()

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

if S[1] in uppStr or S[-1] in uppStr:
  print("WA")
  exit(0)

fl = False

for i in range(2,len(S)):
  if S[i] in lowStr:
    continue
  elif S[i] == 'C':
    if fl:
      print("WA")
      exit(0)
    else:
      fl = True
  else:
    print("WA")
    exit(0)

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

Submission status: Accepted

Solution code:
x = list(input())
#print(x[])

if x[0]=="A" :
	for i in range(2, len(x)-1, 1):
		if x[i]=="C":
			#print(x)
			del	x[i]
			del x[0]
			y="".join(x)
			#print(y)
			if y.islower():
				print("AC")
				break
			else:
				print("WA")
				break
	else:
		print("WA")

else:
	print("WA")

#print(x)

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    S = input()
    ok = True
    if S[0] != 'A':
        ok = False
    cnt = 0
    for x in S[2:-1]:
        if x == "C":
            cnt += 1
    if cnt != 1:
        ok = False
    cnt = 0
    for x in S:
        if x.isupper():
            cnt += 1
    if cnt != 2:
        ok = False
    if ok:
        print ("AC")
    else:
        print ("WA")

Submission status: Accepted

Solution code:
s=input()
flag1,flag2,flag3=False,False,True
import string
for i,moji in enumerate(s):
    if i==0 and moji=="A":
        flag1=True
    elif 2<=i<=len(s)-2 and moji=="C" and flag2==False:
        flag2=True
    else:
        if moji in string.ascii_uppercase:
            flag3=False
            break
if flag1 and flag2 and flag3:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
# coding: utf-8

def pHead(S):
    if S[0] != "A": return False
    return True

def getMid(S):
    return S[2:-1]

def pMid(S):
    mid = getMid(S)
    if "C" not in mid: return False
    if mid.count("C") > 1: return False
    return True

def getRest(S):
    mid = getMid(S)
    tmp = S[1] + mid.replace("C", "") + S[-1]
    return tmp

def solve(S):
    if not pHead(S):
        return "WA"
    if not pMid(S):
        return "WA"
    if not getRest(S).islower():
        return "WA"
    return "AC"

if __name__ == "__main__":
    S = input()
    print(solve(S))

Submission status: Accepted

Solution code:
import re

S = input()

pattern = r'^A[a-z][a-z]*C[a-z]*[a-z]$'

print('AC' if re.match(pattern, S) else 'WA')

Submission status: Accepted

Solution code:
from sys import stdin
s=stdin.readline().rstrip()
ans="AC"
if s[0]!='A':
	ans='WA'
if s.count('C',2,len(s)-1)!=1:
	ans='WA'
s2=s.replace('A','',1)
s2=s2.replace('C','',1)
if not s2.islower():
	ans='WA'
print(ans)

Submission status: Accepted

Solution code:
str = input()

result = "AC"

if str[0:1] != "A":
    result = "WA"
    
if "C" not in str[2:-1]:
    result = "WA"

if str.count("C") != 1:
    result = "WA"
    

str = str.replace("A", "")
str = str.replace("C", "")
if not str.islower():
    result = "WA"

print(result)

Submission status: Accepted

Solution code:
S = input()

if S[0] == "A":
    A = True
else:
    A = False

countC = 0
for i in range(2,len(S)-1):
    if S[i] == "C":
        countC += 1
        place = i
        
if countC == 1:
    C = True
else:
    C = False
    


'''
if C:
    for i in range(1,place):
        lower = S[i].islower()
        if lower == False:
            B = False
    for i in range(place+1,len(S)):
        lower = S[i].islower()
        if (lower):
            B = False
'''

B = False

new = ""
if C:
    for i in range(1,place):
        new = new + S[i]
    for i in range(place+1,len(S)):
        new = new + S[i]

    if new.islower():
        B = True
    else:
        B = False

            
if (A and B and C):
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
S=str(input())
indC=S.find("C")
Flag=0

for i in range(0,len(S)):
    if i!=indC and i!=0:
        SSS=S[i]+""
        if SSS.isupper():
            Flag=1   

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-                                                                                                                                                                  
s = str(input())
j1 = (s[0]=='A')
j2 = False
j3 = False

if 1 == s[2:len(s)-1].count('C'):
    j2 = True
    idx = s[2:len(s)-1].index('C')
    j3 = (s[1:2+idx].islower() and s[2+idx+1:].islower())

if j1 is j2 is j3 is True:
    print ('AC')
else:
    print ('WA')

Submission status: Accepted

Solution code:
s=str(input())
if(s[0]!='A'):
    print('WA')
elif(s[2:len(s)-1].count('C')!=1):
    print('WA')
else:
    flag=0
    for i in s:
        if(ord(i)<97):
            if(i!='A' and i!='C'):
                flag=1
    if(flag==1):
        print('WA')
    else:
        print('AC')

Submission status: Accepted

Solution code:
str = input()
ans = 'WA'
if str[0] == 'A':
    cPlc = str.find('C')
    if cPlc >= 2 and cPlc <= len(str) - 2 and str.find('C',cPlc + 1) == -1:
        AllLower = True
        for i in range(1, len(str)):
            if str[i].isupper() and i != cPlc: AllLower = False
        if AllLower: ans = 'AC'
print(ans)

Submission status: Accepted

Solution code:
s=input()
flag1 = False
flag2 = False
flag3 = False

if s[0] == "A":
    flag1 = True
    
cnt = 0
idx = -1
for i in range(2, len(s)-1):
    if s[i]=="C":
        cnt += 1
        idx = i
if cnt == 1:
    flag2 = True
    
if flag2:
    flag3 = True
    for i in range(len(s)):
        if i != 0 and i != idx and s[i].lower()!=s[i]:
            flag3 = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    s = S()
    if s[0] != 'A':
        return 'WA'
    c = collections.Counter(s)
    if c['A'] != 1 or c['C'] != 1:
        return 'WA'
    if c['B'] > 0:
        return 'WA'
    for t in string.ascii_uppercase[3:]:
        if c[t] > 0:
            return 'WA'
    if 'C' not in s[2:-1]:
        return 'WA'
    return 'AC'


print(main())

Submission status: Accepted

Solution code:
S=input()
a1= (S[0]=="A")
s=S[2:-1]
a2=s.count("C")==1
ss=S.replace("A","").replace("C","")
a3= (ss==ss.lower())

if a1 & a2 & a3:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# B - AcCepted
import re

s = str(input())

if s[0] == "A":
    s = s[1:len(s)]

    s2 = s[1:len(s) - 1]
    arr = re.findall("C", s2)
    if len(arr) == 1:
        s2 = re.sub("C", "", s2)
        s = s[0] + s2 + s[len(s) - 1]

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

print("WA")

Submission status: Accepted

Solution code:
S = input()

flag = False

if S[0] == 'A' and S[2:-1].count('C') == 1 :
  if S.count('A') == 1 and S.count('C') == 1:
    if S.replace('A', 'a').replace('C','c').islower():
      flag = True

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

Submission status: Accepted

Solution code:
S = input()
n = len(S)
countc = 0
counta = 0
for m in range (3, n):
    if S[m-1] == 'C':
        countc = countc + 1
        S = S[:m-1] + 'c' + S[m:]
if S[1-1] == 'A':
    counta = 1
    S = 'a' + S[1:]
if(countc == 1 and counta == 1 and S.islower()):
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
S=input()

T=S.count("C")

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

elif "C" in S[2:-1] and T==1 :
    S2=S.replace("A", "")
    S2=S2.replace("C" , "")
    if S2.islower() :
        print("AC")
    else:
        print("WA")
    
else:
    print("WA")

Submission status: Accepted

Solution code:

#B - AcCepted
S=str(input())
#print(S[0].isupper())
#print(S[1])
length=len(S)
cnt=0
flg=1
ans="WA"
if S[0]=='A' and S.count('C')==1:
    #S[0].replace('A','a')

    ans="AC"
    for i in range(1,length):
        if S[i].isupper() and S[i]!='C':
            ans="WA"
            break
        elif S[i]=='C':
            if i<2 or i>(length-2):
                ans="WA"
                break
print(ans)

Submission status: Accepted

Solution code:
s = str(input())

ans = 'AC'

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

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'

if s.count('C') != 1:
    ans = 'WA'

print(ans)

Submission status: Accepted

Solution code:
#encoding utf-8

s = list(input())

count = []
code_pass = False
if s[0] == "A":
    capital_count = 0
    for i in range(len(s)):
        # print(s[i])
        if "C" == s[i]:
            count.append(i)
            # print(count)

        if s[i].isupper():
            capital_count += 1
            # print(capital_count)

    if len(count) == 1 and 2 <= count[0] <= len(s)-2:
        if capital_count == 2:
            code_pass = True

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

Submission status: Accepted

Solution code:
import re
s = input()
ci = s.find("C")
if s.find("A") == 0 and 2 <= ci <= len(s) - 2:
  tmp = list(s)
  del tmp[0]
  del tmp[ci - 1]
  if re.match("^[a-z]*$", "".join(tmp)):
    print("AC")
    exit()
print("WA")

Submission status: Accepted

Solution code:
def main():
    S = input()
    if S[0] != "A":
        return "WA"
    elif S[2:-1].count("C") != 1:
        return "WA"
    else:
        alf = "abcdefghijklmnopqrstuvwxyz"
        flag = "AC"
        for s in S[1:len(S)]:
            if (not s == "C") and (not s in alf):
                flag = "WA"
    return flag

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
if s[0] == 'A':
    a = 1
else:
    a = 10

if s[2:len(s)-1].count('C') == 1:
    b = 1
else:
    b = 10
count = 0
ss = 'qwertyuioplkjhgfdsazxcvbnm'
for i in s:
    if i in ss:
        count += 1
if count == len(s)-2:
    c = 1
else:
    c = 10

if a+b+c == 3:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = list(input())

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

Submission status: Accepted

Solution code:
import sys
S = list(input())
# S = "Atcoder"
# S = list(S)

if S[0] != "A":
    print("WA")
    sys.exit()
# elif S[1].isupper():
#     print("WA")
#     sys.exit()
# elif S[-1].isupper():
#     print("WA")
#     sys.exit()
elif "C" in S[2:-1]:
    S.remove("C")
    del S[0]
    S = str(S)
    if S.islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
import sys
S = list(input())
# S = "Atcoder"
# S = list(S)

if S[0] != "A":
    print("WA")
    sys.exit()
elif S[1].isupper():
    print("WA")
    sys.exit()
elif S[-1].isupper():
    print("WA")
    sys.exit()
elif "C" in S[2:-1]:
    S.remove("C")
    del S[0]
    S = str(S)
    if S.islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a = str(input())
b = "AC"
if (a[0:1] != 'A'): b = 'WA'
if (not a[1:2].islower()): b = 'WA'
if (a[2:-1].count('C') != 1): b = 'WA'
if (not a[2:-1].replace('C', 'c').islower()): b = 'WA'
if (not a[-1].islower()): b = 'WA'

print(b)

Submission status: Accepted

Solution code:
s = input()
f = [True]

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

slice1 = s[2:-1]
if slice1.count("C")!=1:
    f[0]=False
if (slice1.count("C")==1)and(s[0]=="A"):
    s=s.replace("A","a")
    s=s.replace("C","c")

if s.islower()!=True:
    f[0]=False

if f[0]==True:
    print("AC")
if f[0]==False:
    print("WA")

Submission status: Accepted

Solution code:
S = input()
l = len(S)
flug = 0
if S[0] == "A":
	S = S.replace("A","a")
	if S.count("C")==1 and S.find("C") > 1 and S.find("C") < l-1:
		S = S.replace("C","c")
		if S.lower() == S:
			flug = 1

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

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

Solution code:
s=input()
d='BDEFGHIJKLMNOPQRSTUVWXYZ'
if s[0]=='A' and s.count('A')==1 and s.count('C')==1 and s[2:-1].count('C')==1:
    for t in d:
        if t in s:
            break
    else:
        print('AC')
        exit()
print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
lib = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

if s[0] == "A" and "C" in s[2:-1]:
	idx = s.index("C")
	for i in range(1,len(s)):
		if i == idx:
			continue
		elif s[i] in lib:
			print("WA")
			break
	else:
		print("AC")

else:
	print("WA")

Submission status: Accepted

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

S = input()

if S[0] == "A" and S[2:-1].count("C") == 1:
    for i in range(len(S)):
        if i == 1 or i == len(S)-1:
            if not S[i].islower():
                print("WA")
                exit()
        elif 2 <= i <= len(S)-2:
            if not S[i].islower() and S[i] != "C":
                print("WA")
                exit()
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
S = list(input())
flags = [False,False,False]
if S.pop(0) == "A":
    flags[0] = True
if flags[0] == True: 
    if S[1:len(S)-1].count("C") == 1:
        flags[1] = True
        del S[1+S[1:len(S)-1].index("C")]
if flags[1] == True:
    if "".join(S) == "".join(S).lower():
        flags[2] = True
if False in flags:
    print("WA")
else:
    print("AC")

Submission status: Accepted

Solution code:
import re
p = re.compile(r'^A[a-z]{1,}C[a-z]{1,}$')

S = input()
if bool(p.match(S)):
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
from collections import Counter

s = input()

head = s[0]
mid  = dict(Counter(s[2:-1]))
removed = s.replace('A', '').replace('C', '')
if head == 'A' and mid.get('C') is not None and mid['C'] == 1 and removed == removed.lower():
  print('AC')
else:
  print('WA')

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
str=list(input())
flag=False
for i in range(len(str)):
    if(str[i]!='A' and str[i]!='C'):
        if(ord(str[i])>=ord('a') and ord(str[i])<=ord('z')):
            flag=True
        else:
            flag=False
            break
if(flag and str[0]=='A' and 'C' in str[2:len(str)-1:1] and str.count('C')==1):
    print("AC")
else:
    print("WA")

Submission status: Accepted

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

    ans = f(S)
    ans = regex(S)

    print(ans)


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

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

    import string
    for c in S[1] + S[-1]:
        if c in string.ascii_uppercase:
            return "WA"

    return "AC"


def regex(S):
    import re

    r = re.compile("^A[a-z][^C]*C[^C]*[a-z]$")
    if r.match(S):
        return "AC"
    else:
        return "WA"


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    s = input()
    # s = 'Atcoder'
    if s[0] != 'A':
        print('WA')
        exit(0)

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

    c_index = s.find('C')
    s_sub = ""
    for i, c in enumerate(s):
        if i == 0 or i == c_index:
            continue
        s_sub += c

    if not s_sub.islower():
        print('WA')
        exit(0)

    print('AC')

Submission status: Accepted

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