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: Wrong Answer

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

if __name__ == "__main__":
    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
            continue
        if not (97 <= ord(S[i]) and ord(S[i]) <= 122):
            print("WA")
            exit()
    if count != 1:
        print("WA")
        exit()

    if not (97 <= ord(S[1]) and ord(S[1]) <= 122):
        print("WA")
        exit()

    print("AC")

Submission status: Wrong Answer

Solution code:
S = input()

flag = 'WA'
if S[0] == 'A':
    if 'C' in S[2:-2]:
        S = ''.join(sorted(list(S)))
        if S[2:].islower():
            flag = 'AC'

print(flag)

Submission status: Wrong Answer

Solution code:
s = input()

f = 1
c = 0

for i in range(len(s)):
    on = 0
    if i==0:
        if not s[i]=='A':
            f = 0
            on = 1
    elif i>=2 and i<=len(s)-2:
        if s[i] == 'C':
            c += 1
            on = 1
            
    if on == 0 and s[i].islower()==False:
        f = 0
        
if c!=1:
    f=0
    
if f==0:
    print("WA")
else:
    print("AC")

Submission status: Wrong Answer

Solution code:
s = list(input())
if s[0] == "A" and s[2:-1].count("C") == 1 and s[1].lower() == s[1] and s[-1].lower() == s[-1]:
    print("AC")
else:
    print("WC")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = raw_input()

ok = True
if s[0] != "A":
    ok = False
cnt = 0
for i in s[2:-1]:
    cnt += int(i == "C")
if cnt != 1:
    ok = False
for i in s:
    if i != "C" and i != "A" and i.isupper():
        ok = False
    if i == 'c' or i == 'a':
        ok = False
if ok:
    print "AC"
else:
    print "WA"

Submission status: Wrong Answer

Solution code:
#coding:utf-8
s=input()
count=True
dumy=0
if(s[0]=="A"):
  for i in range(2,len(s)-2):
    if(s[i]=="C"):
      dumy+=1
else:
  count=False
if(dumy>1 and dumy==0):
  count=False
dumy=0
for i in range(len(s)):
  if(s[i]>"A" and s[i]<"Z"):
    dumy+=1
if(dumy!=2):
  count=False
if(count==False):
  print("WA")
else:
  print("AC")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def check (S):
    if S[0] != 'A':
        return False
    cnt = 0;
    for i in range(2, len(S)-1):
        if(S[i] == 'C'):
            cnt = cnt + 1
    if cnt != 1:
        return False

    for i in range(1, len(S)-1):
        if S[i] != 'C' and ('A' <= S[i] and S[i] <= 'Z'):
            return False

    if S[len(S)-1] == 'C':
        return False;
    
    return True

S = input()
ans = check(S)
if ans == True:
    print ("AC")
else:
    print ("WA")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
s = input()

flag = True

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

if "C" not in s[2:-1]:
    print("WA")
    exit()

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

s = s[1:idx]+s[idx+1:]

if s == s.lower():
    print("AC")
else:
    print("WC")

Submission status: Wrong Answer

Solution code:
f1=False
f2=False
f3=True
s = list(input())
if s[0]=='A':
  f1=True
if s[1].isupper():
  f3=False
for i in s[2:-1]:
  if f3==False:
    break
  if i=='C':
    if f2==True:
      f3=False
    else:
      f2=True
  elif i.isupper():
    f3=False
if f1 and f2 and f3:
  s='AC'
else:
  s='WA'
if s[-1].isupper():
    f3=False
print(s)

Submission status: Wrong Answer

Solution code:
s=list(input())
ans="WA"
if s[0]=='A' and s[2:-2].count("C")==1:
    s.remove("C")
    s.pop(0)
    a="".join(s)
    if a.islower():
        ans='AC'
print(ans)

Submission status: Wrong Answer

Solution code:
#coding:utf-8

s = input()
ans = 'AC'
if s[0] != 'A': ans = 'WA'

num_c = 0
for c in s[2:-1]:
    if c == 'C':
        num_c += 1
    else:
        if c.isupper():
            ans = 'WA'
if num_c != 1: ans = 'WA'

if s[-1].isupper(): ans = 'WA'

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = list(input())
k = 0
for i in range(len(a)):
	if i == 0 and a[i] != "A":
		k = 1
		break
	elif i >= 2 and i <= len(a)-2:
		if a[i] == "C":
			k += 2
		elif a[i] > "z" or a[i] < "a":
			k = 1
			break
if k == 2:
	print("AC")
else:
	print("WA")

Submission status: Wrong Answer

Solution code:
S = input()

count = 0
boo = False
if S[0] != 'A':
    print ('WA')
else:
    if S[1].islower() == False:
        print('WA')
    else:
        if S[-1].islower() == False:
            print ('WA')
        else:
            for str_ in S[2:-2]:
                if str_ == 'C':
                    count += 1
                else:
                    if str_.islower() == True:
                        pass
                    else:
                        boo = True

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

Submission status: Wrong Answer

Solution code:
s = list(input())
t = s[2:len(s)-1]
if s[0] != "A":
    print("WA")
else :
    c = 0
    for i in t:
        if i == "C":
            c += 1
    if c!= 1:
        print("WA")
    else :
        for i in s:
            if i != "A" and i != "C" and "A" <= i <= "Z":
                print("WA")
                break
        print("AC")

Submission status: Wrong Answer

Solution code:
ss = str(input())
if ss[0] == "A" and [ss[2], ss[-2] ].count("C") == 1 :
    s = list(ss)
    s[0] = "a"
    s[2] = "a"
    s[-2] = "a"
    a = ""
    for i in s:
        a = a + i
    #print(a)
    if a.islower() :
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
S = input()
ans = True
if S[0] != "A":
    ans = False
T = [S[i] for i in range(len(S)) if i>=2 and i<=len(S)-2]
U = [S[i] for i in range(len(S)) if i!=0]

if "C" not in T:
    ans = False
for char in U:
    if (not char.lower()) and (char!="C"):
        ans = False
if ans:
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
S = input()
res  = 'WA'
if S[0] == "A":
    counter = 0
    if len(S) > 4:   
        for i  in S[2:-2]:
            if i =='C':
                counter += 1
    else:
        if S[2] =='C':
            counter =1
    if counter == 1:
        low = 0
        big = 0
        for i in S:
            if i.islower():
                low += 1
            else:
                big += 1
        if big == 2:
            res = 'AC'
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

def judge(S:str) -> bool:
    if S[0] == "A":
        flag = 0
        for s in S[2:-1]:
            if s == "C":
                flag += 1
        if flag == 1:
            return True
        else:
            return False
        
    else:
        return False
        
def judge2(S:str) -> bool:
    s_list = list(S)
    s_list.remove("A")
    s_list.remove("C")
    for s in s_list:
        if ord(s)<ord("a") or ord(s)>ord("z"):
            return False
    
    return True
    
    
if judge(S):
    if judge2(S):
        print("AC")
    else:
        print("AC")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
def check (S):
    if S[0] != 'A':
        return False
    cnt = 0;
    for i in range(2, len(S)-1):
        if(S[i] == 'C'):
            cnt = cnt + 1
    if cnt != 1:
        return False

    for i in range(1, len(S)-1):
        if S[i] != 'C' and ('A' <= S[i] and S[i] <= 'Z'):
            return False

    if S[1] == 'C':
        return False
    return True

S = input()
ans = check(S)
if ans == True:
    print ("AC")
else:
    print ("WA")

Submission status: Wrong Answer

Solution code:
S = list(input())

f_cd1, f_cd2, f_cd3 = False, False, False
cd3_ng = True
c_cnt, c_idx = 0, -1

if S[0] == 'A' :
    f_cd1 = True
    for i in range(2, len(S) - 2) :
        if S[i] == 'C' :
            c_cnt += 1
            c_idx = i
            
    if c_cnt == 1 :
        f_cd2 = True
        
        for i in range(len(S)) : 
            if (i != 0 and i != c_idx) and S[i] not in list('abcdefghijklmnopqrstuvwxyz') :
                cd3_ng = False
                break
                
        if cd3_ng == True :
            f_cd3 = True
            
if f_cd1 == f_cd2 == f_cd3 == True :
    print("AC")
else :
    print("WA")

Submission status: Wrong Answer

Solution code:
S = input()

yes = S[0] == 'A' and \
      1 == sum(1 for c in S[2:-2] if c == 'C') and \
      2 == sum(1 for c in S if 'A' <= c <= 'Z')
print('AC' if yes else 'WA')

Submission status: Wrong Answer

Solution code:
s=input()
a=0
if s[0]!="A":
    a=1
n=len(s)
for i in range(2,n-1):
    a=1
    if s[i]=="C":
        a=0
        break
t=list(s.lower())
k=list(s)
b=0
for i in k:
    if i not in t:
        b+=1
if b==2 and a==0:
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import re

S = input()

if S[0:1] == "A" and S.count("A") == 1 and S[2:-1].count("C") == 1 and S.count("C") == 1:
	if re.match(r"[ACa-z]", S):
		print("AC")
		exit()

print("WA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

flag = True

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

idx = None
for i, s in enumerate(S[3:-1]):
    if s == 'C':
        if idx == None:
            idx = i + 3
        else:
            flag = False

for i, s in enumerate(S):
    if i == 0 or i == idx:
        continue

    if s != s.lower():
        flag = False

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

Submission status: Wrong Answer

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

    ans = f(S)
    print(ans)


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

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

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

    return "AC"


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def check (S):
    if S[0] != 'A':
        return False
    cnt = 0;
    for i in range(2, len(S)-1):
        if(S[i] == 'C'):
            cnt = cnt + 1
    if cnt != 1:
        return False

    for i in range(1, len(S)-1):
        if S[i] != 'C' and ('A' <= S[i] and S[i] <= 'Z'):
            return False
    return True

S = input()
ans = check(S)
if ans == True:
    print ("AC")
else:
    print ("WA")

Submission status: Wrong Answer

Solution code:
S = input()
lcnt = 0
for i in range(len(S)):
    if ord(S[i]) >= 65 and ord(S[i]) < 91:
        lcnt += 1
if S[0] != "A":
    print("WA")
elif S[2] != "C" and S[-2] != "C":
    print("WA")
elif lcnt > 2:
    print("WA")
else:
    print("AC")

Submission status: Wrong Answer

Solution code:
import re

S = input()

if S[0:1] == "A" and S.count("A") == 1 and S[2:-1].count("C") == 1:
	if re.match(r"[ACa-z]", S):
		print("AC")
		exit()

print("WA")

Submission status: Wrong Answer

Solution code:
s = str(input())
if s[1] == "A" and [s[3], s[-2] ].count("C") == 1 :
    s[1] = a
    s[3] = a
    s[-2] = a
    a = ""
    for i in s:
        a = a + s
    if a.islower() :
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
S = input()
if S[0] == 'A':
    i = S[2:-1].find("C")
    c = S[2:-1].count("C")
    if i != -1 and c == 1:
        i += 2
        for j in range(len(S)):
            if j > 0 and i != j:
                if ord('a') <= ord(S[j]) <= ord('z'):
                    print("AC")
                    exit(0)
print("WA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
flag = True
if S[0] == 'A':
    pass
else:
    flag = False

cnt = 0
for i in range(len(S)-3):
    if S[3+i] =='C':
        cnt += 1
if cnt == 1:
    pass
else:
    flag=False

cnt = 0
for i in range(len(S)):
    if S[i].islower():
        cnt += 1
if cnt == 2:
    pass
else:
    flag=False

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

Submission status: Wrong Answer

Solution code:
s=input()
flag=False
c=0
for i in range(2,len(s)-1):
    if(s[i]=='C'):c+=1
if(s[0]=='A' and c==1):print('AC')
else:print('WA')

Submission status: Wrong Answer

Solution code:
inp = list(input())
flag = True
if inp.pop(0) != "A":
    flag = False
if inp[1:-2].count("C") != 1:
    flag = False
else:
    inp.remove("C")
if not "".join(inp).islower():
    flag = False
if flag:
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import re

S = input()

if S[0:1] == "A" and S[2:-1].count("C") == 1:
	if re.match(r"[ACa-z]", S):
		print("AC")
		exit()

print("WA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
ok = S[0] == "A"
ok = ok and (S[2:-2].count("C") == 1)
ok = ok and (S[:2].count("C") == 0)
ok = ok and (S[-2:].count("C") == 0)
ok = ok and (S[1:].count("A") == 0)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#B
S = input()
res  = 'WA'
if S[0] == "A":
    counter = 0
    for i  in S[2:-2]:
        if i =='C':
            counter += 1
    if counter == 1:
        low = 0
        big = 0
        for i in S:
            if i.islower():
                low += 1
            else:
                big += 1
        if big == 2:
            res = 'AC'
print(res)

Submission status: Wrong Answer

Solution code:
def solve(s):
    if s[0] != "A":
        return "WA"
    if s[2:len(s) - 1].count("C") != 1:
        return "WA"
    return "AC"

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())

if S[0] != 'A' or S[1] == 'C' or S[-1] == 'C':
    print("WA")
else:
    if S.count('C') == 1:
        print("AC")
    else:
        print("WA")

Submission status: Wrong Answer

Solution code:
S = input()
if S[0] == 'A':
    i = S[2:-1].find("C")
    if i != -1:
        i += 2
        for j in range(len(S)):
            if i > 0 and i != j:
                if ord('a') <= ord(S[i]) <= ord('z'):
                    print("AC")
                    exit(0)
print("WA")

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

s = ns()
ok = False
if s.startswith("A"):
    if s[2:-1].count("C") == 1:
        ct = 0
        for c in s:
            if "a" <= c <= "z":
                ct += 1
        if ct == len(s)-2:
            ok = True
print("AC" if ok else "WA")

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re


def answer(s: str) -> str:
    pattern = r'A[a-z]+C[a-z]+'
    return 'AC' if re.fullmatch(pattern, s) else 'WA'


def main():
    s = input()
    print(answer(s))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import re


def answer(s: str) -> str:
    pattern = r'^A[a-z]+C[a-z]+$'
    return 'AC' if re.match(pattern, s) else 'WA'


def main():
    s = input()
    print(answer(s))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()
ans = 0

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

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

cnt = 0
for i in range(len(S)):
    if S[i].isupper():
        cnt += 1
if cnt == 2:
    ans += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

print('AC')

Submission status: Accepted

Solution code:
S=input()
k=0
z=0
cnt=0
if S[0]=='A':
    for i in range(2,len(S)-1):
        if S[i]=='C':
            k=i
            cnt += 1
            z=100
            if z==100 and cnt==1:
                for j in range(1,k):
                    if 'a'<=S[j]<='z':
                        z=200
                    else:
                        print('WA')
                        exit()
                if z==200 :        
                    for l in range(k+1,len(S)):
                        if 'a'<=S[l]<='z':
                            z=102
                        else:
                            print('WA')
                            exit()
if z == 0 or z==100:
    print('WA')
else:
    print('AC')

Submission status: Accepted

Solution code:
s = list(map(str,input()))
if s[0] != "A":
  print("WA")
elif s[2:-1].count("C") != 1:
  print("WA")
else:
  del s[0]
  s.remove("C")
  if "".join(s).islower():
    print("AC")
  else:
    print("WA")

Submission status: Accepted

Solution code:
import sys

S = input()

count = 0
for i in range(len(S)):
    if i == 0 and S[i] != "A":
        print("WA")
        sys.exit()

    if i == len(S)-1 and count != 1:
        print("WA")
        sys.exit()

    if i != 0 and i != len(S)-2 and S[i].isupper() and S[i] != "C":
        print("WA")
        sys.exit()

    if i >= 2 and i <= len(S)-2 and S[i] == "C":
        count += 1

print("AC")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 標準入力を取得
S = input()

# 求解処理
ans = "AC"
if S[0] != "A":
    ans = "WA"

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

# 結果出力
print(ans)

Submission status: Accepted

Solution code:
s = input()
ans = "AC"
c = 0
for i in range(len(s)):
    if i==0 and s[i]!="A":
        ans = "WA"
    if i>=2 and i<len(s)-1:
        if s[i]=="C":
            c += 1
        elif ord(s[i])>=65 and ord(s[i])<=90:
            ans = "WA"
    if i==1 or i==len(s)-1:
        if ord(s[i])>=65 and ord(s[i])<=90:
            ans = "WA"
if c!=1:
    ans = "WA"
print(ans)

Submission status: Accepted

Solution code:
word = input()
flag = False
C_count = 0

if word[0] == 'A':
    for i in range(2,len(word)-1):
        if word[i] == 'C' and C_count == 0:
            C_count += 1
            C_place = i
        elif word[i] == 'C' and C_count == 1:
            C_count += 1

    if C_count == 1:
        for i in range(1,len(word)):
            if word[i].isupper() and i != C_place:
                break
            if i == len(word)-1:
                flag = True
if flag:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
#104B
s = input()
c_list = []
c_count = 0
answer = "WA"
for i in range(2,len(s)-1):
    if s[i] == "C":
        c_list.append(i)
    if s[i].islower() == False:
        c_count += 1
if s[0]=="A" and s[1].islower()==True and s[-1].islower()==True and len(c_list)==1 and c_count==1:
    answer="AC"
print(answer)

Submission status: Accepted

Solution code:
s = input()
count = 0
for i in range(0, len(s)):
    if i == 0 and s[i] == 'A': continue
    if i == 1 and 97 <= ord(s[i]) <= 122: continue
    if 2 <= i <= len(s) - 2:
        if s[i] == 'C':
            count += 1
            continue
        elif 97 <= ord(s[i]) <= 122: continue
    if count == 0 or count >= 2: break
    if i == len(s) - 1 and 97 <= ord(s[i]) <= 122:
        print("AC")
        exit()
print("WA")

Submission status: Accepted

Solution code:
s = input()
answer = 'WA'
if s[0] == 'A':
    if s.count('C',2,len(s) - 1) == 1:
        a = s.index('C')
        t = s[1:a] + s[a + 1:]
        if t.islower():
            answer = 'AC'
            
print(answer)

Submission status: Accepted

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    s = input()
    if s[0]!="A":
        print("WA")
        exit()
    if s[2:-2].count('C')!=1:
        print("WA")
        exit()
    s=s.replace('A','')
    s=s.replace('C','')
    if s.islower()==False:
        print("WA")
        exit()
    else:
        print("AC")


if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
import sys
S = input()

if not (S[0] == "A" and "C" in S[2:len(S)-1]):
    print("WA")
    sys.exit()

S = sorted(S)

if not S[1] == "C":
    print("WA")
    sys.exit()

if not "a" <= S[2] <= "z":
    print("WA")
    sys.exit()

print("AC")

Submission status: Accepted

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


main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
r = "WA"
n = len(S)
l = list(S)

if S[0] == "A" and S[2:n-1].count('C') == 1:
  s = S.replace('A', 'p').replace('C', 'p')
  if s.islower():
    r = 'AC'
print(r)

Submission status: Accepted

Solution code:
S = input()

if S[0] == 'A':
    c = list(S[2:-1])
    if c.count('C') == 1:
        p = c.index('C')
        c.pop(p)
        ans = list(S[1]) + c + list(S[-1])
        anss = ''.join(ans)
        if anss.islower():
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

Solution code:
import sys


def resolve(in_):
    S = next(in_).strip()
    
    if S[0] != 'A':
        return False
    if S.count('C', 2, -1) != 1:
        return False
    i = S.find('C')
    a = S[1:i]
    b = S[i + 1:]
    if not (a.islower() and b.islower()):
        return False
    
    return True


def main():
    answer = resolve(sys.stdin)
    print('AC' if answer else 'WA')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    S = SS()

    if S[0] == 'A' and 'C' in S[2:-1] and len([i for i in S if i in string.ascii_uppercase]) == 2:
        print('AC')
    else:
        print('WA')

if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
s = list(input())
ans = 'AC'
if s[0] != 'A':
    ans = 'WA'
c_idx = None
for i, v in enumerate(list(s)):
    if i >= 2 and i <= len(s)-2:
        if v == 'C':
            if c_idx is None:
                c_idx = i
            else:
                ans = 'WA'
if c_idx is None:
    ans = 'WA'
else:
    s[0] = 'a'
    s[c_idx] = 'c'
    if [ i.lower() for i in s ] != s:
        ans = 'WA'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

if S[0] == "A" and S[2:N-1].count("C") == 1 and sum(s.islower() for s in S) == N-2:
  print("AC")
else:
  print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
if S[0]=='A' and S.count('C')==1 and 'C' in S[2:-1]:
    for c in S[1:len(S)]:
        if not (c.islower() or c=='C'):
            print("WA")
            break
    else:
        print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

s = input().strip()

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

if s.count('C') != 1:
    print('WA')
    sys.exit(0)

if not (2 <= s.find('C') <= len(s) - 2):
    print('WA')
    sys.exit(0)

if not s.replace('A', '').replace('C', '').islower():
    print('WA')
    sys.exit(0)

print('AC')

Submission status: Accepted

Solution code:
S = list(input())
if S[0] != "A":
    print("WA")
    exit()
else:
    idx = -1
    for i in range(2, len(S) - 1):
        if S[i] == "C":
            if idx == -1:
                idx = i
            else:
                print("WA")
                exit()
    if idx == -1:
        print("WA")
        exit()

    for i in range(len(S)):
        if i == 0 or i == idx:
            continue
        else:
            if S[i].islower() == False:
                print("WA")
                exit()
print("AC")

Submission status: Accepted

Solution code:
S = input()

flag = 1
c_count = 0
ans = 'AC'
if S[0] != 'A':
  ans = 'WA'
for i in range(1,len(S)):
  if (i == 1 or i == len(S)-1) and S[i].islower() == False:
    ans = 'WA'
  elif 2 <= i <= len(S)-2:
      if S[i] == 'C':
        c_count += 1
if c_count != 1:
  ans = 'WA'
print(ans)