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:
# -*- coding: utf-8 -*-

s = input()

isStartwithA = False
has1CinMiddle = False
otherArelower = True

if list(s)[0] == "A":
    isStartwithA = True


sample = list(s)[2:-1]
if sample.count("C") == 1:
    has1CinMiddle = True

sample2 = list(s)
sample2 = list(set(sample2))

try:
    sample2.remove("A")
    sample2.remove("C")
except:
    pass
    isStartwithA = False
    has1CinMiddle = False

#print(sample2)

for word in sample2:
    if (not word.islower()):
        otherArelower = False

if isStartwithA and has1CinMiddle and otherArelower:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
import sys
S = input()


if S[0] == "A":
    C = S[2:-1]
    count = 0
    for c in C:
        if c == "C":
            count = count + 1
        if count==2:
            print("WA")
            sys.exit()
    if count==0:
        print("WA")
        sys.exit()
    S = S[1:]

    for s in S:
        if (ord("z") >= ord(s) and ord("a") <= ord(s)):
            continue
        elif s=="C":
            continue
        else:
            print("WA")
            sys.exit()
    print("AC")
    sys.exit()
print("WA")

Submission status: Accepted

Solution code:
S = input()
if S[0] != "A":
    print("WA")
else:
    l = [x for x in S[2:-1] if x == "C"]
    if len(l) != 1:
        print("WA")
    else:
        i = S.index("C")
        for x in S[1:i]+S[i+1:]:
            if not x.islower():
                print("WA")
                exit()
        else:
            print("AC")

Submission status: Accepted

Solution code:
S=input()
case1=False
case2=False
cnt=0
for i in range(len(S)):
  if i==0 and S[i]=="A":
    case1=True
  if S[i]=="C" and 2<=i<=len(S)-2:
    case2=True
  if S[i].lower()!=S[i]:
    cnt+=1
if case1 and case2 and cnt==2:
  print("AC")
else:
  print("WA")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

flag = True
if s[0] != "A":
    flag = False

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

for i in s[1:]:
    if i == "C":
        continue
    if i.isupper():
        flag = False

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

Submission status: Accepted

Solution code:
s = input()
check = True
count_C = s[2:-1].count("C")
for i in range(len(s)):
    if i == 0:
        if not (s[i] == "A"):
            check = False
    elif i == 1:
        if not (s[i].islower()):
            check = False
    else:
        if not(s[i].islower()) and not(s[i] == "C"):
            check = False
if check and count_C == 1:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()

if s[0] != 'A' :
  print("WA")
elif s[2:-1].count('C') !=1:
  print("WA")
else:
  s = ''.join([i for i in s if i not in 'AC'])
  if s.islower() :
    print('AC')
  else  :
    print('WA')

Submission status: Accepted

Solution code:
S = input()


def check(s):
    if not s[0] == "A":
        return False
    if not s[2:-1].count("C") == 1:
        return False
    count = 0
    for c in s[1:]:
        if not c.lower() == c:
            count += 1
            if count > 1:
                return False
    return True


print("AC" if check(S) else "WA")

Submission status: Accepted

Solution code:
S=input()
n=len(S)
dai='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
sho='abcdefghijklmnopqrstuvwxyz'

out='AC'
if S[0]!='A':
  out='WA'
  
counter=0
ind=0
for i in range(2, n-1):
  if S[i]=='C':
    counter+=1
    ind=i
    
if counter!=1:
  out='WA'
  
for i in range(n):
  if i!=0 and i!=ind:
    for j in range(26):
      if S[i]==dai[j]:
        out='WA'
        
print(out)

Submission status: Accepted

Solution code:
#coding:utf-8
import re

S = input()
flag = 0
#一文字目がA
if S[0] == 'A':
    flag += 1
#Sの先頭から3文字目と末尾から2文字目の間（両端含む）に大文字のCがちょうど1個
if S[2:len(S)-1].count('C') == 1:
    flag += 1
#以上の A, C を除く S のすべての文字は小文字(大文字は2文字目以降に1つだけ)
if len(re.findall(r'[A-Z]', S[1:])) == 1:
	flag += 1


#条件が全部合えばAC
if flag == 3:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
import re

#正規表現使用. [a-z]は小文字アルファベット.$は完全一致, +は一回以上の繰り返し
print(re.match("A[a-z]+C[a-z]+$", input()) and "AC" or "WA")

# matchしてるものなければNoneなのでorで結ばれた"WA"
# その他ならばTrue扱いでandで結ばれた"AC"を出力.

Submission status: Accepted

Solution code:
#coding:utf-8
S = input()
flag = 0
#一文字目がA
if S[0] == 'A':
    flag += 1
#Sの先頭から3文字目と末尾から2文字目の間（両端含む）に大文字のCがちょうど1個
if S[2:len(S)-1].count('C') == 1:
    flag += 1
#以上の A, C を除く S のすべての文字は小文字(大文字は2文字目以降に1つだけ)
up_case = 0
for i in range(1, len(S)):
    if S[i].isupper() == True:
        up_case += 1

if up_case == 1:
    flag += 1

#条件が全部合えばAC
if flag == 3:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s=input()
flag=1
if s[0]!="A":
    flag=0
else:
    t= s[2:-1].replace("C","",1)
    u= s[2:-1].replace("C","",2)
    if s[2:-1]==t or t!=u:
        flag=0
    else:
        t = s.replace("A","",1).replace("C","",1)
        if t.lower()!=t:flag=0
print("AC" if flag else "WA")

Submission status: Accepted

Solution code:
def judge(string):
    if string[0] != "A" or "C" not in string[2:len(string) - 1]:
        return False
    list_ = list(string)
    list_.remove("A")
    list_.remove("C")
    return all(c.islower() for c in list_)

print("AC" if judge(input()) else "WA")

Submission status: Accepted

Solution code:


S = input()

ans = 'WA'

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

Submission status: Accepted

Solution code:
S = input()

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

if S[1].isupper() or S[-1].isupper():
    print('WA')
    exit()

C = False
for s in S[2:-1]:
    if s == 'C':
        if not C:
            C = True
            continue
        else:
            print('WA')
            exit()

    if s.isupper():
        print('WA')
        exit()

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

Submission status: Accepted

Solution code:
import re

S = input()

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

Submission status: Accepted

Solution code:
w=input()
flag=0
if w[0]=='A' and w.count('C')==1 and w.count('A')==1 and w[1].lower()==w[1] and w[-1].lower()==w[-1]:
    flag+=0
else:
    flag=1    
if w.replace('A','').replace('C','').lower()==w.replace('A','').replace('C',''):
    flag+=0
else:flag=1
if flag:print('WA')
else:print('AC')

Submission status: Accepted

Solution code:
s = input()
s.index

def check(s):
    try:
        res = s.index("C", 2, -1)
    except ValueError:
        return False
    if ((s[1:res]+s[res+1:]).islower()):
        return True


if (s[0] == "A" and check(s)):
    print("AC")
else:
    print("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")
  for s in S:
    if "a" <= s <= "z":
      pass
    else:
      print("WA")
      break
  else:
    print("AC")
else:
  print("WA")

Submission status: Accepted

Solution code:
s=input()
if s[0]!='A' or s[1]=='C' or s[-1]=='C' or s[1].isupper() or s[2:-1].count('C')!=1:
  print('WA')
  exit()
  
s=''.join([c for c in s[1:] if c!='C'])
if s.islower():
  print('AC')
else:
  print('WA')

Submission status: Accepted

Solution code:
import copy

s = list(input())
s_t = copy.deepcopy(s)
##if s[0] =="A" and "C" in s[2:-2]:
#    if
counter = 0
 
if s[0] != "A":
    print("WA")
    exit()
 
if not "C" in s[2:-1]:
    print("WA")
    exit()
 

c = False
komojo = True

for i in range(len(s)):
    if  2 <= i <= len(s)-2:
        if s[i] == "C":
            if c == True:
                print("WA")
                exit()
            elif c != True:
                c = True
            #continue
        elif not s[i].islower():
            komojo = False
    elif i != 0 and not s[i].islower():
        komojo = False
        

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=str(input())
if s[0]!="A":
    print("WA")
    exit()
    
if s.count("C")!=1:
    print("WA")
    exit()
    
else:
    x=s.index("C")
    if x>=2 and x<=len(s)-2:
        y=s.replace("A","a")
        z=y.replace("C","c")
        if z.islower():
          print("AC")
        else:
          print("WA")
    else:
        print("WA")

Submission status: Accepted

Solution code:
s = input()
l = s.find("C")
r = s.rfind("C")
a = s[1:]
a = a.replace("C","")
if s[0] != "A" or s[-1] == "C" or l != r or 2 > l or not a.islower():
  print("WA")
else:
  print("AC")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
def main():
  if S[0] != "A":
    print("WA")
    exit()
  head = S[:2]
  if head in ("C"):
    print("WA")
    exit()
  tail = S[-1:]
  if tail in ("C"):
    print("WA")
    exit()
  
  sub = S[2:]
  sub = sub[:-1]
  if sub.count("C") != 1:
    print("WA")
    exit()
  
  for x in S[1:]:
    if x !="C":
      if x.isupper():
        print("WA")
        exit()
  print("AC")
  
if __name__ == "__main__":
  main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

print("WA")

Submission status: Accepted

Solution code:
S = input()

SLEN = (len(S))

A = list(S)



small = 0

for i in range(SLEN):
    if A[i].islower() == True:
        small = small + 1

big = (SLEN - small) 

Check= S[2:SLEN-1]
CNUM=Check.count("C")

if A[0] == "A" and  big == 2 and CNUM == 1 and A[-1] != "C":  
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
S = input()
cheack1 = False
cheack2 = False
cheack3 = False
count = 0

if S[0]=='A':
    cheack1=True
    S = S.replace("A", "a")

if S[1]=="C" or S[int(len(S))-1]=="C":
    cheack2==False
else:
    for i in range(2, int(len(S))-1):
        if S[i]=="C":
            count += 1

    if count==1:
        cheack2=True
        S = S.replace("C","c")

cheack3 = S.islower()

#print(str(cheack1)+" "+str(cheack2)+" "+str(cheack3))
if cheack1 and cheack2 and cheack3:
    print("AC")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

if 'C' not in s[1 : - 1]:
    print('WA')
    quit()
else:
    s = list(s)
    s.pop(s.index('C'))
    s = ''.join(s)
    if s.lower() != s:
        print('WA')
        quit()
print('AC')

Submission status: Accepted

Solution code:
S = input()
A = False
C = False
ans = 'WA'
if S[0] == 'A':
  A = True
if S[2:-1].find('C') != -1 and S[2:-1].find('C') == S[2:-1].rfind('C'):
  S = S.lstrip('A')
  D = S[S.find('C')+1:]
  E = S[:S.find('C')]
  if D.islower() == True and E.islower() == True:
    C = True
if A == True and C == True:
  ans = 'AC'
print(ans)

Submission status: Accepted

Solution code:
S = input()
if S[0] == 'A' and S[2:-1].count('C') == 1:
    index_c = S[2:-1].index('C')
    S = S[1:2 + index_c] + S[3 + index_c:]
    if S.islower():
        print('AC')
        exit()
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].islower() and s[2:].replace("C","").islower():
        print("AC")
        sys.exit()
print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = str(input())

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

Submission status: Accepted

Solution code:
S=list(input())
x=S.pop(0)
if x!='A':
  print('WA')
else:
  for i in range(1,len(S)-1):
    if S[i]=='C':
      del S[i]
      if str.islower("".join(S)):
        print('AC')
        break
      else:
        print('WA')
        break
  else:
    print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
if S[0] != "A":
    print("WA")
    exit()
num_C = 0
pos_C = 0
for i in range(2, len(S) - 1):
    if S[i] == "C":
        num_C += 1
        pos_C = i
if num_C != 1:
    print("WA")
    exit()
for i in range(1, len(S)):
    if i == pos_C:
        continue
    if S[i].isupper():
        print("WA")
        exit()
print("AC")

Submission status: Accepted

Solution code:
wa = 0
count = 0
s = input()
if s[0] != "A":
    wa = 1
for i in range(1, len(s)):
    if s[i] == "C" and i not in  {len(s)-1,1} :
        count += 1
        if count >= 2:
            wa = 1
    else:
        if s[i].isupper():
            wa = 1
print("AC" if not wa and count else "WA")

Submission status: Accepted

Solution code:
S=input()
N=len(S)
if S[0]!='A':
    print('WA')
else:
    cnt = 0
    for i in range(2,N-2+1):
        if S[i]=='C':
            cnt += 1
    if cnt != 1:
        print('WA')
    else:
        D=(S[0].isupper()>0)
        flg=0
        for i in range(1,N):
            if D==(S[i].isupper()>0):
                flg+=1
        if flg==1:
            print('AC')
        else:
            print('WA')

Submission status: Accepted

Solution code:
import sys
import re


cnt = 1
input_arr = []
for l in sys.stdin:
  input_arr.append(l.split("\n")[0])
  if len(input_arr) == cnt:
      break
S = input_arr[0]
if len(re.sub(r'A[a-z]+C[a-z]+', '', S)) == 0:
    print("AC")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

test = 0
check = 0

if s[0]=='A':
	for i in range(2,len(s)-1):
		if s[i]=='C':
			test = test + 1
			
	if test == 1:
		for j in range(len(s)):
			if s[j]=='A':
				pass
			elif s[j]=='C':
				pass
			elif s[j].isupper():
				pass
			else:
				check = check +1
			
		if check == len(s)-2:	
			print('AC')
		else:
			print('WA')
		
	else:
		print('WA')

else:
	print('WA')

Submission status: Accepted

Solution code:
S = list(input())
cnt = 0

for i in range(0,len(S)):
    if i == 0:
        if S[i] != "A":
            print("WA")
            exit()
    elif 2 <= i <= len(S) - 2:
        if S[i] == "C":
            cnt += 1
    if S[i].isupper() and S[i] != "C" and i != 0:
        print("WA")
        exit()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
n=len(s)
if s[0] != "A":
  print("WA")  
  exit()
if s[2:n-1].count("C") != 1:
  print("WA")
  exit()
s=s.replace("A", "")
s=s.replace("C", "")
if not s.islower():
  print("WA")
  exit()
print("AC")

Submission status: Accepted

Solution code:
import sys
s=list(input())
n=len(s)
if s[0]!="A":
    print("WA")
    sys.exit()
    
C_count=0
word=list("abcdefghijklmnopqrstuvwxyz")
for i in range(2,n-1):
    if s[i]=="C":
        C_count+=1
    elif s[i] in word:
        continue
    else:
        print("WA")
        sys.exit()
if C_count==1:
    if s[1] in word and s[n-1] in word:
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
import numpy as np

S=np.asarray(list(input()))
cond1=(S[0]=="A") # 先頭が"A"であるかどうか
ci=(S=="C") # "C"かどうか
cond2=(ci[2:-1].sum()==1) # [2:-1]の間にちょうど1個出現するかどうか
Snac=S[np.logical_not(ci)][1:] # 先頭と"C"を除く
cond3=np.char.islower(Snac).all() # 上が全て小文字かどうか

if (cond1 and cond2 and cond3): # 全ての条件を満たすならOK
    print("AC")
else: # 満たさないならNG
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = list(input())
k = False
p = False
if A[0] == 'A' and A[1].islower() == True and  A[-1].islower() == True and "C" in A[2:-1]:
  A.pop(0)
  A=str(A)
  A = A.replace('C', '', 1)
  k = A.islower()
if k:
  print('AC')
else:
  print('WA')

Submission status: Accepted

Solution code:
A = list(input())
k = False
p = False
if A[0] == 'A' and A[1].islower() == True and  A[-1].islower() == True:
  A.pop(0)
  A=str(A)
  for a in A:
    if a == 'C':
      p =True
  A = A.replace('C', '', 1)
  k = A.islower()
if k and p:
  print('AC')
else:
  print('WA')

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import re

def solve(S: str):
    pattern = "A[a-z][a-z]*C[a-z]+"
    if re.fullmatch(pattern, S):
        print("AC")
    else:
        print("WA")

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    S = str(input())
    solve(S)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
S=input()
C1=S[0]=='A' and S[-1].islower()
C1=C1 and S[1].islower()
C2=0
C3=0
for i in S[2:len(S)-1]:
  if i=='C':
    C2+=1
  elif i.islower():
    C3=C3
  else:
    C3+=1
if C1 and C2==1 and C3==0:
  print('AC')
else:
  print('WA')

Submission status: Accepted

Solution code:
s = list(input())
ans = "AC"
if s[0]!="A":
    ans ="WA"

n = len(s)
a = 0
for i in range(1,n):
    x = ord(s[i])
    if x==ord("C") and i!=1 and i!=n-1:
        a+=1
        continue
    
    if ord("a")<=x and x <= ord("z"):
        continue
    else:
        ans ="WA"
if a!=1:
    ans ="WA"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
ans = 'AC'
if S[0] != 'A':
    ans = 'WA'
cnt = 0
for i in S[2:len(S) - 1]:
    if i == 'C':
        cnt += 1
if cnt != 1:
    ans = 'WA'
cnt = 0
for i in S:
    if 'A' <= i and i <= 'Z':
        cnt += 1
if cnt != 2:
    ans = 'WA'
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for s in S:
    X.append(s)

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
S = input()

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

Submission status: Accepted

Solution code:
import re

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
S = list(input())

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

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

Submission status: Accepted

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

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

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

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

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

Submission status: Accepted

Solution code:
s = input()

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

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

Submission status: Accepted

Solution code:
# ABC 104: B – AcCepted
s = input()

lowers = 'abcdefghijklmnopqrstuvwxyz'
is_satisfied = 'AC'

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

print(is_satisfied)

Submission status: Accepted

Solution code:
from sys import stdin

s = stdin.readline().rstrip()

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

print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import string

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

c = 0
check = 0

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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