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()
S=list(s)
cc=0
for i in range(2,len(S)-1):
  if S[i]=='C':
    cc=cc+1
if cc>=1:
  S.remove('C')
S.remove(S[0])
count=[]
if s[0]=='A':
  count.append(1)
if cc==1:
  count.append(2)
if ''.join(S).islower():
  count.append(3)

if count==[1,2,3]:
  print('AC')
else:
  print('WA')

Submission status: Accepted

Solution code:
n=input()
count=0
for i in range(len(n)):
    if i==0:
        if n[i]=='A':
            continue
        else:
            print('WA')
            exit()

    elif i==1 or i==len(n)-1:
        if n[i].islower():
            continue
        else:
            print('WA')
            exit()

    else:
        if n[i]=='C':
            count+=1
            if count>=2:
                print('WA')
                exit()
        elif n[i].islower():
            continue
        else:
            print('WA')
            exit()

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

Submission status: Accepted

Solution code:
s = input()

if s[0] == "A" and s[2:-1].count("C") == 1:
  idx_C = s[2:-1].index("C") + 2
  s = s[1:idx_C] + s[idx_C+1:]
  if s.lower() == s:
    print("AC")
    exit()
print("WA")

Submission status: Accepted

Solution code:
S = input()


ans = 0
num = 0
cnum = 0

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

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

for j in range(len(S)):
  if S[j].islower() == True:
    num += 1

    
if num == len(S)-2:
  ans +=1
  
  
  

if ans ==3:
  print("AC")
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"

T = S[1:].replace("C","c",1)

if not T.islower() :
    ans = "WA"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
flag = True
C_cnt = 0
for i in range(len(S)):
    if i==0:
        if S[i]!="A":
            flag = False
            break
    elif i>=2 and i<len(S)-1:
        if S[i]=="C":
            C_cnt += 1
        elif ord(S[i]) < 97 or ord(S[i]) > 122:
            flag = False
            break
    else:
        if ord(S[i]) < 97 or ord(S[i]) > 122:
            flag = False
            break
if flag==True and C_cnt==1:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
# coding: utf-8

def isValid(target:str):
    if target[0] != "A":
        return False
    if target.count("A") != 1:
        return False
    if target.count("C") != 1:
        return False
    if target[2:len(target)-1].count("C") != 1:
        return False
    for i in target:
        if i == "A":
            continue
        if i == "C":
            continue
        if "a" <= i <= "z":
            continue
        return False
    return True

if isValid(input().rstrip()):
    print("AC")
else:
    print("WA")

Submission status: Accepted

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


S_list=list(input().strip())
sub_S = S_list[2:-1]

if S_list[0] != "A"  or  sub_S.count("C") != 1:
    print("WA")
    sys.exit()

check_S = S_list[:]
del check_S[ 2 + sub_S.index("C") ]
del check_S[0]

if ("".join(check_S)).islower():
    print("AC")
else:
    print("WA")
    sys.exit()

Submission status: Accepted

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


S_list=list(input().strip())
sub_S = S_list[2:-1]

if S_list[0] != "A"  or  sub_S.count("C") != 1:
    print("WA")
    sys.exit()

check_S = S_list[:]
del check_S[ 2 + sub_S.index("C") ]
del check_S[0]

for word in check_S:
    if "a" <= word <= "z":
        continue
    else:
        print("WA")
        sys.exit()

print("AC")

Submission status: Accepted

Solution code:
S = input()
f = True
if S[0] != 'A':
  f = False
elif S[2:-1].count('C') != 1:
  f = False
else:
  for s in S[1:]:
    if s not in 'Cabcdefghijklmnopqrstuvwxyz':
      f = False
      break
print('AC' if f else 'WA')

Submission status: Accepted

Solution code:
s = input()
if s[0] != 'A':
    print('WA')
    exit(0)
if s[2:-1].count('C') != 1:
    print('WA')
    exit(0)
for i in range(1,len(s)):
    if i >= 2 and i < len(s)-1 and s[i] == 'C':
        continue
    if not (ord('a') <= ord(s[i]) and ord(s[i]) <= ord('z')):
        print('WA')
        exit(0)
print('AC')

Submission status: Accepted

Solution code:
def is_u(c):
    return c == c.upper()
S = input()
a = S[0] == "A"
b = S[2:-1].count("C") == 1
c = sum([int(is_u(c)) for c in S]) == 2
# print(a, b, c)
if a and b and c:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = str(input())
C_count = 0
a = 0
b = 0
c = 0
k = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
if s[0] == "A":
  a += 1
for i in s[2:-1]:
  if i == "C":
    C_count += 1
if C_count == 1:
  b += 1

l = s[1:]
l = l.replace("C","")
if l.islower() == True:
  c += 1
if a == 1 and b == 1 and c == 1:
  print("AC")
else:
  print("WA")

Submission status: Accepted

Solution code:
s = str(input())
flag = 0
C_count = 0
flag_2 = 0
mode = 0
a = 0
b = 0
c = 0
k = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
if s[0] == "A":
  a += 1
for i in s[2:-1]:
  if i == "C":
    C_count += 1
if C_count == 1:
  b += 1

l = s[1:]
l = l.replace("C","")
if l.islower() == True:
  c += 1
if a == 1 and b == 1 and c == 1:
  print("AC")
else:
  print("WA")

Submission status: Accepted

Solution code:
S = str(input())

a=0
b=0
c=0
if S[0]=='A':
    a=1

cnt=0
for i in S[2:-1]:
    if i=='C':
        cnt+=1
if cnt==1:
    b=1

s=S[1:]
s=s.replace('C','')
if s.islower()==True:
    c=1

if a==1 and b==1 and c==1:
    print('AC')
else:
    print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

#chr(ord('a')

ans = True
if s[0] != "A":
    print("WA")
elif s[2:-1].count("C") != 1:
    print("WA")
else:
    s.remove("A")
    s.remove("C")
    if not str(s).islower():
        print("WA")
    else:
        print("AC")

Submission status: Accepted

Solution code:
s = input()
if s[0]=="A":
    checker = 0
    for i in range(2, len(s)-1):
        if s[i] =="C":
            checker += 1
    if checker == 1:
        checker = 0
        for i in range(len(s)):
            if ord(s[i])<97:
                checker += 1
        if checker == 2:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    flg=1
    s=STR()
    n=len(s)
    c=0
    if s[0]=='A' and 'C' in s[2:n-1]:
        if s.count('C')==1:
            c=s.index('C')
        else:
            flg=0
    else:
        flg=0
    
    for i in range(n):
        if i==0 or i==c:
            pass
        else:
            if s[i].islower():
                pass
            else:
                flg=0
    if flg==1:
        print('AC')
    else:
        print('WA')
    
if __name__ == '__main__':
    do()

Submission status: Accepted

Solution code:
S=input()
print('WAAC'[S[0]=='A' and S.count('C',2,-1)==1 and len(list(filter(lambda x: x.isupper(),list(S))))==2::2])

Submission status: Accepted

Solution code:
S = input()
cond1 = S[0] == 'A'
cond2 = S.count('C', 2, -1) == 1
cond3 = S[1:].replace('C', '', 1).islower()
flag = cond1 * cond2 * cond3
print('WAC'[flag:][:2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=list(input())

abc=set([chr(ord('A')+i) for i in range(26)])

if S[0]=='A':
    cnt=0
    ind=0
    for i in range(2,len(S)-1):
        if S[i]=='C':
            cnt+=1
            ind=i
    if cnt==1:
        del S[ind]
        del S[0]
        for s in S:
            if s in abc:
                print('WA')
                exit()
        print('AC')
        exit()
print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
s_len=len(s)
ans="WA"
t=""
if s[0]!="A":
    print(ans)
else:
    t+=s[0].lower()
    t+=s[1]
    count=0
    for i in range(2,s_len-1):
        if s[i]=="C":
            count+=1
            t+=s[i].lower()
        else:
            t+=s[i]
    t+=s[s_len-1]
    if count!=1 or t!=s.lower():
        print(ans)
    else:
        print("AC")

Submission status: Accepted

Solution code:
S = input()

ans = "AC"

w = "BDEFGHIJKLMNOPQRSTUVWXYZ"
cnt = 0
for i, s in enumerate(S):
    if i == 0:
        if s != "A":
            ans = "WA"
            break
    elif 2 <= i <= len(S) - 2:
        if s == "C":
            cnt += 1
        elif s in w:
            ans = "WA"
            break
    else:
        if s in w:
            ans = "WA"
            break
if cnt != 1:
    ans = "WA"

print(ans)

Submission status: Accepted

Solution code:
S = input()
if S[0]=="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:
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:
def resolve():
	s=input()
	if s.count('A')!=1 or s.count('C')!=1 or s[0]!='A':
		print('WA')
	elif 'C' not in s or s.index('C')<2 or s[-1]=='C':
		print('WA')
	elif s.replace('A','').replace('C','')!=(s.replace('A','').replace('C','')).lower():
		print('WA')
	else:
		print('AC')
resolve()

Submission status: Accepted

Solution code:
s = input()

if (s[0] == 'A') and s[2:-1].count('C') == 1:
    s = s[1:].replace('C', '')
    if s.islower():
        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:
    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 = list(input())
if (s[0] == "A") and (s[2:-1].count("C")==1):
    s[0] = "a"
    s[s[2:-1].index("C")+2] = "c"
    l = list()
    for i in range(len(s)):
        l.append(s[i].lower())
    #(s,l)
    if s == l:
        print("AC")
        exit()
print("WA")

Submission status: Accepted

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

S = input()
a = S[0] == "A"
b = collections.Counter(S[2:-1])["C"] == 1
c = S.replace("A", "").replace("C", "").islower()

ans = "AC" if a and b and c else "WA"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#104_B
S=input()
S_upper=S.upper()
flg= S[0]=='A' and S[2:-1].count('C')==1 and S.count('A')==1 and S.count('C')==1 and set(S)&set(S_upper)=={'A','C'}
print('AC' if flg else 'WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
cnt = 0
if s[0] == 'A' and s[1].islower() and s[-1].islower():
    for i in range(len(s)-3):
        if s[i+2] == 'C':
            cnt += 1
        elif s[i+2].islower():
            continue
        else:
            cnt = None
            break
if cnt == 1:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = input()
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:
S = input()

c_count = 0
if S[0] == 'A' and S[1].islower() and S[-1].islower():
    for s in S[2:-1]:
        if s == 'C':
            c_count+=1
        elif s.islower():
            continue
        else:
            c_count = None
            break

if c_count == 1:
    print('AC')
else:
    print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
ans = "WA"
if S[0] == "A" and ("a" <= S[1] <= "z") and ("a" <= S[-1] <= "z"):
  s0 = S[2:-1]
  f = 0
  for i in range(len(s0)):
    if s0[i] == "C":
      if f != 0:
        ans = "WA"
      else:
        ans = "AC"
        f = 1

print(ans)

Submission status: Accepted

Solution code:
s = input()

if s[0] == "A" and "C" in s[2:-1]:
    d = s[2:-1].index("C")
    A = s[1:d+2] + s[d+3:]
    B = [j for j in range(ord("a"), ord("z") + 1)]
    t = 0
    for i in A:
        if ord(i) not in B:
            t = 1
            break
    if t == 0:
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

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

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

if count != 1:
    flag = False

for i in range(len(s)):
    if s[i] == 'A' or s[i] == 'C':
        pass
    else:
        if s[i].islower():
            pass
        else:
            flag = False
if flag:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    S = input()

    if (S[0] == 'A' and
            S[2:-1].count('C') == 1 and
            all([s.islower() for s in S if s not in ['A', 'C']])):
        print('AC')
    else:
        print('WA')


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
f=True
s=input()
if s[0]!="A":f=False
if s.count("C")==0 or s.count("C")>=2:f=False
else:
    i=s.index("C")
    if i==1 or i==len(s)-1:f=False
    else:
        for x in range(len(s)):
            if x==i or x==0:continue
            if s[x].isupper():f=False
if f:print("AC")
else:print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
t = 0

for i in range(0, len(s)):
  if(s[i].isupper()):
    t = t + 1
  else:
    pass

try:
  if 2 <= s.index('C') and s.index('C') <= len(s)-2 and s.index('A')==0:
    if t == 2:
      print('AC')
    else:
      print('WA')
  else:
    print('WA')

except ValueError:
  print('WA')

Submission status: Accepted

Solution code:
def input_int():
    return map(int, input().split())

def input_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

S=one_str()

flg = False
if S[0]=="A":
    if "C" in S[2:-1]:
        indC = S[2:-1].index("C")+2
        ss = S[1:indC] + S[indC+1:]
        if ss.islower():
            flg =True

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S=input()
if S[0]=='A' and S[2:-1].count('C')==1:
    s=list(S)
    s.remove('C')
    S=''.join(s)
    if S.istitle()==True:
        print('AC')
        exit()
print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()

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

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

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

S=S[1]+S[2:i]+S[i+1:len(S)]

if S.islower():
  print('AC')
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"

if not s.replace("C","c")[1:].islower():
  ans = "WA"

print(ans)

Submission status: Accepted

Solution code:
S=input()
N=len(S)

f=0
if S[0]=="A":
    f+=1
    
if S.count("C")==1:
    f+=10
    
if S.count("A")==1:
    f+=100
    
for i in range(N):
    if S[i]=="C":
        if i>=2 and i<=N-2:
            f+=1000
            break

Uc=0        
for i in range(N):
    if S[i]==S[i].upper():
        Uc+=1
        
if Uc==2:
    f+=10000
    
if f==11111:
    print("AC")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
word=input()
cflg=True
if word[0]!='A':
  cflg=False
elif word[2:-1].count('C')!=1:
  cflg=False
cnt=0
for l in word[1:]:
  if l.isupper():
    cnt+=1
else:
  if cnt!=1:
    cflg=False
  
if cflg:
  print('AC')
else:
  print('WA')

Submission status: Accepted

Solution code:
S = input()

def stringChecker(S):
    if S[0] != 'A':
        return False
    cnt = 0
    for l in S[2:-1]:
        if l == 'C':
            cnt += 1
    if cnt != 1:
        return False
    
    lower_cnt = 0
    for l in S:
        if l.islower():
            lower_cnt += 1
    if lower_cnt != len(S) - 2:
        return False
    
    return True
if stringChecker(S):
    print('AC')
else :
    print('WA')

Submission status: Accepted

Solution code:
# 25minutes. 
# 簡単なのだが問題をちゃんと読めていないため'WA'を2回繰り返した！

l = list(input())
m = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')

x = 0
for j in l:
    if j in m:
        x += 1

a = 0
for i in range(2,len(l)-1):
    if l[i] == 'C':
        a += 1
if a == 1 and l[0] == 'A' and x == 2:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
# 

l = list(input())
#print(l)
m = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
#print(m)

x = 0
for j in l:
    if j in m:
        x += 1

a = 0
for i in range(2,len(l)-1):
    if l[i] == 'C':
        a += 1
if a == 1 and l[0] == 'A' and x == 2:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
inp = input()

#print(inp.startswith("A"))
#print(inp[2:len(inp)-1].count("C") ==  1)
#print(inp[1:inp.find("C", 0, len(inp) - 1)] == inp[1:inp.find("C", 0, len(inp) - 1)].lower())
#print(inp[inp.find("C", 0, len(inp) - 1) + 1:len(inp)] == inp[inp.find("C", 0, len(inp) - 1) + 1:len(inp)].lower())

if inp.startswith("A") and inp[2:len(inp)-1].count("C") ==  1 and inp[1:inp.find("C", 0, len(inp) - 1)] == inp[1:inp.find("C", 0, len(inp) - 1)].lower() and inp[inp.find("C", 0, len(inp) - 1) + 1:len(inp)] == inp[inp.find("C", 0, len(inp) - 1) + 1:len(inp)].lower():
  print("AC")
else:
  print("WA")

Submission status: Accepted

Solution code:
s=input()

p=s[0]=="A" and s[2:-1].count("C")==1
q=(s[1]+s[2:-1].replace("C","c")+s[-1]).islower()
ans=p and q
print("AC" if ans is True else "WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
if S[0] != 'A':
    print("WA")
elif ord(S[1]) < 97:
    print('WA')
elif ord(S[-1]) < 97:
    print("WA")
else:
    cnt = 0
    for i in range(1, len(S)-1):
        if S[i] == 'C':
            cnt += 1
    if cnt == 1:
        print("AC")
    else:
        print("WA")

Submission status: Accepted

Solution code:
import  re
s = input()
print(s[0] == "A" and s[2:-1:].count("C") ==1 and len(re.findall("[a-z]",s)) == len(s)-2 \
        and "AC" or "WA")

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()

t = 'a'
for i in range(1, len(s)):
    if s[i] == 'C':
        t += 'c'
    else:
        t += s[i]

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 = list(input())
flg = True

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

count = 0
for i in s[2:-1]:
    if i == "C":
        count += 1
if count != 1:
    flg = False

n = 0
for i in s:
    if i.isupper():
        n += 1
if n != 2:
    flg = False

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

Submission status: Accepted

Solution code:
s = input()
length = len(s)
cnt = 0

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

if length == 4:
    if s[2] == 'C':
        cnt = 1
else:
    for i in range(2, length-1):
        cnt += 1 if s[i] == 'C' else 0

if cnt != 1:
    print('WA')
    exit()

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

if up_cnt != 2:
    print('WA')
    exit()

print('AC')

Submission status: Accepted

Solution code:
import re

S = input()

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

Submission status: Accepted

Solution code:
s = input()
lower = "qwertyuiopasdfghjklzxcvbnm"
no = False
if s[0] != "A":
  no = True
if s[2:len(s)-1].count("C") != 1:
  no = True
if no:
  print("WA")
  exit()
ls = list(s)
ls.pop(ls.index("A"))
ls.pop(ls.index("C"))
sls = ""
for lsi in ls:
  sls += lsi
if sls != sls.lower():
  print("WA")
  exit()
print("AC")

Submission status: Accepted

Solution code:
import numpy as np

def main():

    test = input()
    if test[0] != "A":
        print("WA")
        return

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

    for i in range(len(test)):
        if i == 0 and test[i] == "A": continue
        if 2 <= i <= len(test) - 2 and test[i] == "C": continue

        if test[i].lower() != test[i]:
            print("WA")
            return

    print("AC")







if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from collections import Counter
S = input()
def lower_s(string):
    big_c = 0
    for c in string[1:]:
        if c == "C":
            if big_c == 1:
                return False
            else:
                big_c = 1
                continue
        if c == c.upper():
            return False
    return True
if (S[0] == "A") and (Counter(S[2:-1])["C"] == 1) and lower_s(S):
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
S = input()
flag = False
cflag = False
count = 0
cnum = -1
for i in range(len(S)):
    if 2 <= i:
        if i <= (len(S)-2):
            if S[i] == "C":
                count += 1
                cnum = i
            if count == 1:
                cflag = True

if S[0] == "A":
    if cflag:
        flag = True
        for i in range(len(S)):
            if i != 0:
                if i != cnum:
                    a = ord(S[i])
                    if a <= 90:
                        flag = False
if flag:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()
count_c = 0

if s[0] == 'A':
  if s[2:-1].count('C') == 1:
    for i in range(1, len(s)):
      if 97 <= ord(s[i]) <= 122:
        continue
      else:
        count_c += 1
      if count_c > 1:
        print("WA")
  else:
    print("WA")
else:
  print("WA")

if count_c == 1:
  print("AC")

Submission status: Accepted

Solution code:
alf = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
s = input()
if s[0] != 'A':
  print('WA')
  exit()
cnt = 0
pos = 0
for i,c in enumerate(s[2:-1]):
  if c == 'C':
    cnt += 1
    pos = i+2
if cnt != 1:
  print('WA')
  exit()
for i,c in enumerate(s[1:]):
  if i+1 != pos and c in alf:
    print('WA')
    break
else:
  print('AC')

Submission status: Accepted

Solution code:
import sys

s=input()
c_count=0
flag=False


for ss in s:
    if ss.isupper():
        if ss!='A' and ss!='C':
            print('WA')
            sys.exit()

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

if c_count==1:
    flag=True

if flag:
    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')
else:
  for i,c in enumerate(s):
    if i == 0 or i>1 and c == 'C':
      continue
    else:
      if not 'a'<=c<='z':
        print('WA')
        break
  else:
    print('AC')

Submission status: Accepted

Solution code:
import re

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

Submission status: Accepted

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

count=0
for i in range(2,len(s[2:])+1):
	if s[i]=='C':
		count+=1
		c=i
if count!=1:
	print("WA")
	sys.exit()
s=s.replace(s[c],'')
s=s.replace(s[0],'')
if not s.islower():
	print("WA")
	sys.exit()

print("AC")

Submission status: Accepted

Solution code:
S=input()
s=""
flag=1
Cflag=1
if not(S[0]=="A"):
    flag=0
s="".join((s,S[1],S[len(S)-1]))

S2=S[2:len(S)-1]
#print(S)
for i in range(len(S2)):
    if not(S2[i]=="C"):
        s="".join((s,S2[i]))
    else:
        Cflag=Cflag-1
if not(Cflag==0):
    flag=0
if s.islower()==False:
    flag=0
#print(s.islower(),Cflag,s,S[1].islower(),S[len(S)-1].islower())

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

Submission status: Accepted

Solution code:
s=input()
x=0
ans="WA"
if s[0]=="A":
  if s[2:-1].count("C")==1:
    x=s[2:-1].find("C")+2
    t=s[1:x]+s[x+1:]
    if t.islower():
      ans="AC"
print(ans)

Submission status: Accepted

Solution code:
s=str(input())
can=int(1)

if s[0]!='A':
    can=0

count=int(0)
big=int(0)

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

if count!=1:
    can=0

for i in range(1,len(s)):
    if i==big:
        continue

    if s[i].isupper():
        can=0

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

Submission status: Accepted

Solution code:
import re

def solve(s):
    return 'AC' if re.match('^A[a-z]+C[a-z]+$', s) else 'WA'

_s = input()
print(solve(_s))

Submission status: Accepted

Solution code:
S = list(map(str, input()))
flg = 1

if S[0] != "A":
	flg = 0

ctr = 0
for i in range(2, len(S) - 1):
	if S[i] == "C":
		ctr += 1
if ctr != 1:
	flg = 0

ctr = 0	
for s in S:
	if ord(s) <= 90:
		ctr += 1
if ctr != 2:
	flg = 0
	
	
if flg:
	print("AC")
else:
	print("WA")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
s = input()
# flagで複数条件の管理をした方が頭がバグらない
flag = 1
if s[0] != "A": flag = 0

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

for i in range(len(s)):
    if s[i] in "AC": pass
    elif 97 <= ord(s[i]) <= 122: pass
    else: flag = 0
print("AC" if flag else "WA")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
s = input()
if s[0] != "A": print("WA")
elif s[2:-1].count("C") != 1: print("WA")
else:
    for i in range(len(s)):
        if s[i] in "AC": pass
        elif 97 <= ord(s[i]) <= 122: pass
        else:
            print("WA")
            exit(0)
    print("AC")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
if s[0]=='A':
  s=s.lstrip('A')
else:
  print('WA')
  exit()

if s[1:-1].count('C')==1:
  s=s.replace('C','')
else:
  print('WA')
  exit()
  
if s.islower():
    print('AC')
else:
  print('WA')