Problem:


Score : 200 points

Problem Statement

You are given a string S. Each character of S is uppercase or lowercase English letter.
Determine if S satisfies all of the following conditions:

The initial character of S is an uppercase A.

There is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).

All letters except the A and C mentioned above are lowercase.

Constraints

4 ≤ |S| ≤ 10 (|S| is the length of the string S.)

Each character of S is uppercase or lowercase English letter.

Input

Input is given from Standard Input in the following format:

S

Output

If S satisfies all of the conditions in the problem statement, print AC; otherwise, print WA.

Sample Input 1

AtCoder

Sample Output 1

AC

The first letter is A, the third letter is C and the remaining letters are all lowercase, so all the conditions are satisfied.

Sample Input 2

ACoder

Sample Output 2

WA

The second letter should not be C.

Sample Input 3

AcycliC

Sample Output 3

WA

The last letter should not be C, either.

Sample Input 4

AtCoCo

Sample Output 4

WA

There should not be two or more occurrences of C.

Sample Input 5

Atcoder

Sample Output 5

WA

The number of C should not be zero, either.



Sample input:
AtCoder


Sample output:
AC

Submission status: Accepted

Solution code:
S = input()

if S[0] != 'A' or not 'C' in S[2:-1] or not S[1].islower() or not S[-1].islower():
    print('WA')
    exit()
n = 1
for i in S[2:-1]:
    if i.islower():
        pass
    elif i == 'C' and n==1:
        n-=1
    else:
        print('WA')
        exit()
print('AC')

Submission status: Accepted

Solution code:
import re

S = input()

def main():
    m = re.match(r'^A[a-z](?P<mid>[a-zC]+)[a-z]$', S)
    if m is None:
        ans = "WA"
    else:
        mid = m.group("mid")
        if mid.count("C") == 1:
            ans = "AC"
        else:
            ans = "WA"
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(input())
b = "BDEFGHIJKLMNOPQRSTUVWXYZ"
c = list(b)

if a.count("A") != 1 or a.count("C")!= 1:
  print("WA")
elif a.index("A") == 0 and a.index("C") >= 2 and a.index("C") <= (len(a)-2):
  for i in range(len(a)):
    if a[i] in c:
      print("WA")
      break
  else:
    print("AC")
else:
  print("WA")

Submission status: Accepted

Solution code:
s = input()
ans = 'AC'
if s[0] == 'A' and (s[1]+s[-1]).islower() == True:
    ss = list(s[2:-1])
    cnt = 0
    for t in ss:
        if t == 'C':
            cnt += 1
        elif t.islower() == False:
            ans = 'WA'
    if cnt != 1:
        ans = 'WA'
else:
    ans = 'WA'
print(ans)

Submission status: Accepted

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

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()
if s[2:-1].count('C')!=1:
	print('WA')
	exit()
for i in s[2:-1]:
	if i.isupper() and i!='C':
		print('WA')
		exit()
print('AC')

Submission status: Accepted

Solution code:
s = input()
d1 = False
d2 = False
d3 = False
if s[0] == 'A':
    d1 = True
cnt = 0
for i in range(2, len(s)-1):
    if s[i] == 'C':
        cnt += 1
if cnt == 1:
    d2 = True
cnt2 = 0
for j in range(len(s)):
    if s[j].islower():
        cnt2 += 1
if cnt2 == len(s) - 2:
    d3 = True
print('AC' if d1 and d2 and d3 else 'WA')

Submission status: Accepted

Solution code:
#文字列を入力
s = input()
sub_s = s[2:-1]

#先頭がA
res = s[0] == "A"
if res:
    #先頭から3文字目～最後から2文字目間にC
    res = sub_s.count("C") == 1
    if res:
        index = sub_s.index("C") + 2
        #A,C以外小文字
        res = s[1:index].islower() and s[index+1:].islower()

#出力
print("AC" if res else "WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

def main():
    s = input()
    if check(s):
        print('AC')
    else:
        print('WA')

def check(s):
    pat = re.compile(r'A[a-z][a-z]*C[a-z]*[a-z]')
    m = pat.fullmatch(s)
    return bool(m)

main()

Submission status: Accepted

Solution code:
s = input()
t = list(s)
x = 0
y = 0
z = 0
r = []

if t[0] == "A":
  x = 1
  
r.append(t[1])
r.append(t[len(t) - 1])

for i in range(2,len(t) - 1): 
  if t[i] == "C":
    y += 1
  else:
    r.append(t[i])

for j in r:
  if j.isupper():
    z = 1

if x == 1 and y == 1 and z == 0:
  print("AC")
else:
  print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def solve(S):
    if S[0] != "A":
        return "WA"
    if S[2:-1].count("C") != 1:
        return "WA"
    for c in S:
        if c != "A" and c != "C":
            if str(c).isupper():
                return "WA"
    return "AC"


def main():
    S = input()

    print(solve(S))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()

ans = 'AC'
c = 0

for i, s in enumerate(S):
    if i == 0:
        if s != 'A':
            ans = 'WA'
    elif i == 1:
        if s.isupper():
            ans = 'WA'
    elif i > 1 and i < len(S) - 1:
        if s == 'C':
            c += 1
        elif s.isupper():
            ans = 'WA'
    else:
        if s.isupper():
            ans = 'WA'

if c != 1:
    ans = 'WA'

print(ans)

Submission status: Accepted

Solution code:
s=input()
if s[0]!='A':
  print('WA')
  exit()
if not (s[2:-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:
S=input()
if S[0]=='A' and S.count('C', 2, len(S)-1)==1:
  L = list(S)
  del L[S.find('C', 2, len(S)-1)]
  del L[0]
  for i in L:
    if i.isupper() is True:
      A = 'WA'
      break
    else:
      A = 'AC'
  print(A)
else:
  print('WA')

Submission status: Accepted

Solution code:
from sys import stdin


def main() -> None:
    s = next_str()
    print(("WA", "AC")[judge(s)])


def judge(s: str) -> bool:
    flg = False
    n = len(s)

    for i in range(n):
        if i == 0:
            if s[i] != 'A':
                return False
        elif 2 <= i < n - 1 and s[i] == 'C' and not flg:
            flg = True
        elif s[i] != s[i].lower():
            return False

    if not flg:
        return False
    return True


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = list(input())

def conditionA(s_list):
    return s[0] == "A"

def conditionC(s_list):
    return "C" in s_list[2:-1]

def conditionLower(s_list):
    return sum([e.isupper() for e in s_list]) == 2

if conditionA(s) and conditionC(s) and conditionLower(s):
    print("AC")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import string

def accepted(s):
    if s[0] != 'A':
        return "WA"
    if s[1] == 'C':
        return "WA"
    if s[-1] == 'C':
        return "WA"
    c = 0
    for ss in s[1:]:
        if ss == 'C':
            c += 1
        elif ss not in string.ascii_lowercase:
            return "WA"
    if c != 1:
        return "WA"
    return "AC"

s = input()
print(accepted(s))

Submission status: Accepted

Solution code:
S = input()

if S[0]=='A' and S[2:-1].count('C')==1:
    S=S[1:].replace("C", "c")
    if S.islower()==True:
        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:
    S=S.replace("A", "a")
    S=S.replace("C", "c")
    if S.islower()==True:
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = input()
count = 0
if( S[0] == 'A' and S[2:-1].count('C') == 1):
    for i in range(len(S)):
        if S[i].isupper():
            count += 1
            if count == 3:
                print("WA")
                exit()
    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:
import re
S = input()
if re.match('^A[a-z]+C[a-z]+$', S):
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = input()

def f(S):
    if S.startswith('A'):
        if S[2:-1].count('C') == 1:
            hantei = S[1] + S[2:-2].replace('C', 'c') + S[-1]
            if hantei.islower():
                return 'AC'
    return 'WA'

print(f(S))

Submission status: Accepted

Solution code:
s = input()
count = 0
for i in range(len(s)):
    # 0番目の文字がA
    if i == 0:
        if s[i] != 'A':
            break
    # 大文字が出現したとき
    elif s[i].isupper():
        # Cの条件を満たせばcountを増やす
        if 2 <= i < len(s) - 1 and s[i] == 'C':
            count += 1
        # そうでなければcountを0にし、ループ終了
        else:
            count = 0
            break
# カウントが1なら
if count == 1:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = input()
count = 0
for i in range(len(s)):
    # 0番目の文字がA
    if i == 0:
        if s[i] != 'A':
            break
    # 大文字が出現したとき
    elif s[i].isupper():
        # Cの条件を満たせばcountを増やす
        if 2 <= i < len(s) - 1 and s[i] == 'C':
            count += 1
        # そうでなければcountを0にし、ループ終了
        else:
            count = 0
            break
# カウントが1なら
if count == 1:
    print('AC')
else:
    print('WA')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
if S[0] != 'A':
    print('WA')
    exit()
a=0
for i in range(2, len(S) - 1):
    if S[i]=='C':
        j=i
        a+=1
if a!=1:
    print('WA')
    exit()
for i in range(len(S)):
    if (i!=0)&(i!=j):
        a=S[i]
        if a.isupper():
            print('WA')
            exit()
print('AC')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import string
s=input()
if s[0]!='A':
  print('WA')
  sys.exit()
elif s[1] in string.ascii_uppercase or s[-1] in string.ascii_uppercase:
  print('WA')
  sys.exit()
else:
  c=0
  for i in s[2:-1]:
    if i in string.ascii_uppercase:c+=1
  if c!=1:
    print('WA')
    sys.exit()
  print('AC')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
s = input()

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

Submission status: Accepted

Solution code:
s = input()
ans = 0
if s[0] == 'A':
    ans += 1
cnum = 0
for i in range(2,len(s)-1):
    if s[i] == 'C':
        cnum += 1
if cnum == 1:
    ans += 1
hantei = 0
for i in range(len(s)):
    if s[i].islower():
        pass
    else:
        hantei += 1
if hantei == 2:
    ans += 1
if ans == 3:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1:
    i = s.index('C') # Cの0オリジンで探してその場所を代入
    #print(i)
    ss = s[1:i] + s[i+1:] #全体の2文字目（1オリジン）からi番目までと、iのあとの末尾までの文字判定
    if ss.islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter
S = list(input())

if S[0] == 'A':
    if S[2:-1].count('C') == 1:
        idx = S[2:-1].index('C')
        del S[idx+2]
        del S[0]
        s = ''.join(S)
        if s.islower():
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = input()
if s[0] == "A" and s[2:-1].count("C") == 1:
  i = s.index("C")
  ss = s[1:i] + s[i+1:]
  if ss.islower() == True:
    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:
    i = S.index('C')
    jj = S[1:i]+S[i+1:]
    if jj.islower() == True:
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

Solution code:
S=input()
t= [str(c) for c in S]
flag=0
#S の先頭の文字は大文字の A である。
if t[0]!="A":
    flag=1
b=0
i=0
#S の先頭から 3 文字目と末尾から 2 文字目の間（両端含む）に大文字の C がちょうど 1 個含まれる。
for i in range(2,len(t)-1):
    if t[i]=="C":
        b += 1
if b!=1:
    flag=1
#以上の A, C を除く S のすべての文字は小文字である。
i=0
for i in range(len(t)):
    if t[i]=="A" or t[i]=="C" :
        continue
    elif ord(t[i])>90:
        continue
    else:
        flag=1
        break

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

Submission status: Accepted

Solution code:
string = list(input())

def isA(strlist):
    if strlist[0] == 'A':
        return True

def isC1(strlist):
    if strlist[2:-1].count('C') == 1:
        return True

def issmall(strlist):
    strlist = strlist[2:-1] + [strlist[1]] + [strlist[-1]]
    strlist.remove('C')
    string = ''.join(strlist)
    if string.islower():
        return True


if isA(string) and isC1(string) and issmall(string):
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = input()

def f(S):
    if S[0] is not "A":
        return(False)
    if not "C" in S[2:-1]:
        return(False)
    if [str.isupper(c) for c in S].count(True) != 2:
        return(False)
    return(True)

if f(S):
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = list(input())

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

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

n = s.index('C')
t = []

for i in range(len(s)):
    if i != 0 and i != n:
        t.append(s[i])

tt = ''.join(t)

if tt.islower():
    print("AC")

else:
    print("WA")

Submission status: Accepted

Solution code:
word = input()

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

result="AC"
ccount = 0
for i, c in enumerate(word[1:], 1):
    if c.islower():
        continue
    if c == 'C' and i > 1 and i < len(word) - 1:
        ccount += 1
        continue
    result = "WA"
    break
if ccount != 1:
    result = "WA"
print(result)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input()
c = s.find('C', 2, len(s) - 1)

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

Submission status: Accepted

Solution code:
# coding:utf-8

INF = float('inf')


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


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

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

if cnt != 1: ans = 'WA'
if S[-1].isupper(): ans = 'WA'
if S[1].isupper(): ans = 'WA'
print(ans)

Submission status: Accepted

Solution code:
S = input()
flag = True
if S[0] != "A":
    flag = False
C = 0
bi = 0
for i in range(len(S)):
    if 2 <= i < len(S) - 1:
        if S[i] == "C":
            C += 1
    if S[i].upper() == S[i]:
        bi += 1

if bi != 2:
    flag = False

if C != 1:
    flag = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
if s[0] == "A":
  C = []
  for i in range(2, len(s)-1):
    if s[i] == "C":
      C.append(i)
  if len(C) != 1:
    print("WA")
  else:
    up = False
    for j in range(1,len(s)):
      if j == C[0]:
        continue
      elif not s[j].islower():
        up = True
    if up:
      print("WA")
    else:
      print("AC")
else:
  print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

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

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

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

Submission status: Accepted

Solution code:
S = input()
R = S[2:-1]
T = S.replace('A', '')
T = T.replace('C', '')

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

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")
	else:
		print("WA")	
else:
	print("WA")

Submission status: Accepted

Solution code:
s = list(input())

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

ss = s[2:-1]
if ss.count("C") != 1:
    flag = False
for si in s:
    if si != "A" and si != "C":
        if si.islower() != True: 
            flag = False
            
print("AC" if flag else "WA")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s=list(input())
n=len(s)
if s[0]!='A':print('WA')
else:
  c=0
  for i in range(2,n-1):
    if s[i]=='C':c+=1
  if c!=1:print('WA')
  else:
    s.remove('A')
    s.remove('C')
    t=''.join(s)
    u=t.lower()
    if t==u:print('AC')
    else:print('WA')

Submission status: Accepted

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

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

cnt = 0
for char in s[2:-1]:
    if char=='C':
        cnt += 1
if cnt!=1:
    print ('WA')
    exit()

cnt_upper = 0
for char in s:
    cnt_upper += char.isupper()
if cnt_upper != 2:
    print ('WA')
    exit()

print ('AC')

Submission status: Accepted

Solution code:
s = input()

result = "WA"
if s[0] == 'A' and s[2: -1].count('C') == 1:
    idx = s[2: -1].index('C')
    new = s[1:idx+2] + s[idx+3:]
    if new.islower():
        result = 'AC'
print(result)

Submission status: Accepted

Solution code:
s = input()
text = s[2:-1]
r = s.replace('A', '')
r = r.replace('C', '')

if s[0] != 'A' or text.count('C') != 1 or r != r.lower():
    print('WA')
else:
	print('AC')

Submission status: Accepted

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

def judge(s):
    if s[0] != 'A':
        return False
    if s[2:-1].count('C') != 1:
        return False
    if not s[1:].replace('C', 'c').islower():
        return False
    return True

s = input()
if judge(s):
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
B - AcCepted
https://beta.atcoder.jp/contests/abc104/tasks/abc104_b

"""
import sys
from sys import stdin
input = stdin.readline


def solve(S):
    result = 'AC'
    if S[0] != 'A':
        result = 'WA'
    if S[2:-1].count('C') != 1:
        result = 'WA'
    S = S[1:2] + S[2:-1].replace('C', 'c') + S[-1:]
    if not S.islower():
        result = 'WA'
    return result


def main(args):
    S = input().strip()
    ans = solve(S)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
"""
B - AcCepted
文字列 S が与えられます。S のそれぞれの文字は英大文字または英小文字です。 S
が次の条件すべてを満たすか判定してください。

S の先頭の文字は大文字の A である。
Sの先頭から 3 文字目と末尾から 2 文字目の間（両端含む）に大文字の C がちょうど 1
個含まれる。
以上の A, C を除く S のすべての文字は小文字である。
"""

s = input()

cnt_C = 0
ans = True
if s[0] != "A":
    ans = False
    #print("s[0] is not A")
else:
    length = len(s)

    n = 1
    for check_char in s[1:]:
        #print(check_char)
        
        if check_char.islower() is False:
            if check_char != "C" or n == 1 or n == (length - 1):
                ans = False
            
            cnt_C += 1
        
        n += 1

if cnt_C != 1:
    ans = False

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

Submission status: Accepted

Solution code:
s = input()
part_of_s = s[2:-1]
sub_s = s.replace('A','')
sub_s = sub_s.replace('C','')

if s[0] != 'A' or part_of_s.count('C') != 1 or sub_s != sub_s.lower():
    print('WA')
    exit()

print('AC')

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
cnt = 0
s = input()
if s[0]=="A" and "C" in s[2:-1]:
    for i in s:
        if "A" <= i <= "Z":
            cnt +=1
    if cnt == 2:
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()
flag = True

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

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

Submission status: Accepted

Solution code:
S = input()
flag = True

if (S[0] != 'A'): 
  flag = False
if (S[2:-1].count('C') != 1):
  flag = False
if (S.lower() != S.replace('A','a').replace('C','c')):
  flag = False
  
if flag:
  print('AC')
else:
  print('WA')

Submission status: Accepted

Solution code:
S = input()
flag = True

if (S[0] != 'A' or S[2:-1].count('C') != 1 or S.lower() != S.replace('A','a').replace('C','c')):
  flag = False
  
if flag:
  print('AC')
else:
  print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

flag =0
if s[0] !="A":
    flag =1
else:
    index=2
    count=0
    while index<len(s)-1:
        if s[index]=="C":
            count+=1
        index+=1
    if count!=1:
        flag=1
    else:
        index2=0
        count2=0
        while index2<len(s):
            if s[index2]=="A" or s[index2]=="C":
                count2+=1
            elif s[index2].islower():
                pass
            else:
                flag=1
            index2+=1
        if count2!=2:
            flag =1
    
if flag==0:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
S = input()
accept = False

if S[0] == "A" and S[2:-1].count("C") == 1:
    i =  S.index("C")
    S = S[1:i] + S[i+1:]
    if S.islower():
        accept = True

if accept:
    print("AC")

else:
    print("WA")

Submission status: Accepted

Solution code:
S = list(str(input()))
S2 = list(S)
if("A" in S2):
	S2.remove("A")
if("C" in S2):
	S2.remove("C")
s = "".join(S2)

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

Submission status: Accepted

Solution code:
S=input()
if S.find('A')==0 and len(S)-2>=S.find('C')>=2:
	S=S.replace('A','a',1)
	S=S.replace('C','c',1)
	if S.islower():
		print('AC')
	else:
		print('WA')
else:
	print('WA')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

if "A" != s[0]:
    print("WA")
    exit()
s_extracted = s[2:-1]
if s_extracted.count("C") != 1:
    print("WA")
    exit()
# Get Upper characters without "A", "C"
s_upper = [
    chara for chara in s if chara != "C" and chara != "A" and chara.isupper()
]
if len(s_upper) > 0:
    print("WA")
    exit()

print("AC")

Submission status: Accepted

Solution code:
s=list(input())
n=len(s)
s_in_not = [a for a in s[1:] if 'C' not in a]
s_not = ''.join(s_in_not)
s_not.islower()
if not s[0]=='A':
    print("WA")
elif not s[2:n-1].count("C")==1:
    print("WA")
elif not s_not.islower()==True:
    print("WA")
else:
    print("AC")

Submission status: Accepted

Solution code:
S=input()
def judge(S):
    count=0
    count_1=0
    T=[]
    if(S[0]=="A"):
        T.append("a")
        T.append(S[1])
        for s in range(2,len(S)-1):
            if(S[s]=="C"):
                T.append("c")
                count_1+=1
            else:
                T.append(S[s])
        if(count_1==1):
            T.append(S[-1])
            R="".join(T)
            if(R.lower()==R):
                return "AC"
    return "WA"
print(judge(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
Flag = False

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

Submission status: Accepted

Solution code:
S = input()
mid = list(S[2:-1])
try:
    mid.remove('C')
except:
    pass
mid = ''.join(mid)
three = S[1] + mid + S[-1]

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

Submission status: Accepted

Solution code:
import string

S = input()

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

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

if S[1] == 'C' or S[-1] == 'C':
    print('WA')
    exit()

for s in string.ascii_uppercase.replace('C', ''):
    if s in S[1:]:
        print('WA')
        exit()

print('AC')

Submission status: Accepted

Solution code:
A=list(input())
n=len(A)
if(A[0]!="A"):print("WA")
elif(A.count("C")!=1):print("WA")
elif(A.index("C")<2 or A.index("C")>n-2):print("WA")
else:
  A.pop(A.index("C"))
  A.pop(0)
  S="".join(A)
  if(S.islower()):print("AC")
  else:print("WA")

Submission status: Accepted

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

Submission status: Accepted

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