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: Runtime Error

Solution code:
S = input()

flag = False
if S[0] != 'A':
    print('WA')
    quit()
elif S.count('C') != 1:
    print('WA')
    quit()
elif S[2] == 'C' or S[-2] == 'C':
    c_index = S.index('C')
    if c_index == 2:
        disc = S[1] + S[3:]
    elif c_index == len(S) - 2:
        disc = S[1:len(S) - 2] + S[-1]
alpha = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(disc)):
    if not disc[i] in alpha:
        print('WA')
        quit()
    else:
        continue
print('AC')
#print(disc)

Submission status: Runtime Error

Solution code:
S=input()
flag=False

if S[0]=="A":
  if S[2:-1].count("C")==1:
    pos=S.find("C")
    T=S[1:pos]+S[pos+1:]
    if T.islower():
      print("AC")
      flag=True
      
if flag=False:
  print("WA")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys
import itertools#これは色々使える組み込み関数みたいなやつ
import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
i=0
j=0
#N=int(input())
#N, W=input().split()
S=input()
#T=input()
#S_list=list(S)
#h_list=  list(map(int, input().split(" ")))
#M=int(input())
#drink_list = [list(map(int, input().split(" ")))for i in range(M)]
#print(T_list[1])
#N=int(N)
#W=int(W)
#不本意だが内包表記で二次元の空のリストを作成する

#dp=[['' for i in range(2)] for j in range(N)]
#K=int(K)
#S_list=[]
sentence_list=[]
#total=0
#mojiretu=""
#センテンスを暗記するのではなく、まずinput()を書いて、膨らます感じで記述する。すると#思考の流れ通りに書ける。素晴らしい！
#for i in range(K):
# ID_list.append(i+1)
#print(ID_list)
#for i in range(H)
#この下の行が二次元リストの読み込
#intを消して記号を読み込めるようにしたしかしこれでは文字列から読み込んでいるのと同じ
#weight_value_list =  [list(input())for i in range(N)]#一文字づつばらして入れてしまう
#s = [input() for i in range(N)]
#複数行に複数の入力値を取得し、出力する
#sentence_list =  (list(input())for i in range(N))
#for i in range(H):
#  ppixel_list=list(input())
#
#print(pixel_list)
#high_pixel_list =[['' for i in range(W)]for j in range(2*H)]
#print(high_pixel_list)
#print(pixel_list[0][1])#行　列の順番にかっこが並んでいる
#print(a_list)
first_term=0
second_term=0
#整数二次元配列を読み込む時のやり方
#a_b_c_list =  [list(map(int, input().split(" ")))for i in range(N)]

#センテンスを暗記するのではなく、まずinput()を書いて、膨らます感じで記述する。すると#思考の流れ通りに書ける。素晴らしい！
#print(S)
#sentence_list=sorted(S)
sentence_list=list(S)
#print(sentence_list)
#スペースでいれつつ値を取得
if len(S) <4 or len(S) > 10:
    print("WA")
    sys.exit()

if sentence_list[0]=="A":# and sentence_list[2]=="C":
    #print(1231234)
    #del sentence_list[0]
    pass
else:
    print("WA")
    sys.exit()

for j in range(len(sentence_list)-3):
    #print(len(S))
    #print(j+4)
    #if j+4==len(sentence_list):
        #print("WA")

        #sys.exit()
    if sentence_list[j+2]=="C":
        #del sentence_list[j+2]
        p=j+2
        break

#print(sentence_list)
del sentence_list[p]
del sentence_list[0]
#print(sentence_list)

S="".join(sentence_list)

if S.islower()==True:
    print("AC")
    sys.exit()
print(123)
print("WA")


#x, y = [0]*N, [0]*N#N個の空のリストを作成
#l = list(range(N))#範囲がNのリストを作成する

#for i in range(N):
#  x[i], y[i] = map(int, input().split())
#分けて入力する形式を設定することで可読性が高く仕上がっている
#素晴らしいことだ


distance = 0
#comb = list(itertools.permutations(l))
#prmutation:英語の意味としては順列である
'''p[, r]で
長さrのタプル列、重複なしのあらゆる並びを表す
今回はリストlの重複なしの並び替え順序を新たなリストに収納している
並び方を計算しリストに収納しているイメージ
l[0,1,2]
l[0,2,1]これにもリスト番号が0,1,2と割り振られている
これが全通り入っている
これ作った人はすごい
自分も早く理解したい
'''
#for i in range(0, len(comb)):#i番目のパターンの時を考える。
#  for j in range(0, N-1):#lのリスト番号を読み込み
#    distance += math.sqrt((x[comb[i][j]]-x[comb[i][j+1]])**2 + (y[comb[i][j]]-y[comb[i][j+1]])**2)
'''
各経路の距離を足していき全距離分を経路数
で割れば平均距離が出るので各経路ごとの距離は
不必要と判断されている。
'''
#print(distance/len(comb))
i=0
j=0
#1を選んだとき0,2を選ぶってのがどう実装すべきかわからんかった
#だからここで学ぶ
#2019/1/4参考サイトに見当たらず 　仕方がないのでその場しのぎ
#for i in range(N):
for j in range(3):
        pass
      # dp[i+1][j]=max(dp[i][j]+a_b_c_list[i],dp[i][j],dp[i][j])
#リストを一周するようにすればいいのか

Submission status: Runtime Error

Solution code:
S = input()
s = list(S)
j= 0
count = 0
if not s[0] == 'A':
    print('WA')
    exit()

for i in s[2:-1]:
    if i == 'C':
        count += 1
        tmp = j
    j += 1
if not count == 1:
    print('WA')
    exit()

del S[0]
del S[tmp-1]

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

print('AC')

Submission status: Runtime Error

Solution code:
s=input()
S=list(s)
cc=0
for i in range(2,len(S)-1):
  if S[i]=='C':
    cc=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: Runtime Error

Solution code:
s=input()
S=list(s)
cc=0
for i in range(2,len(S)-1):
  if S[i]=='C':
    cc=cc+1
    S.remove(S[i])
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: Runtime Error

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 j.islower() == True:
    num += 1

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

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

Submission status: Runtime Error

Solution code:

a=list(str(input()))

if a[0]!='A':
            print('WA')
            exit()
else:
            b=0
            b=a[2:-1].count('C')
            if b==1:
                        print('AC')
            else:
                        print('WA')
                        exit()

a=list(str(input()))
for i in range(1,len(a)):
            if a[i].isupper():
                     if a[i]=='C'in a[2:-2]:
                                    continue
            print('WA')
            exit()
else:
            print('AC')

Submission status: Runtime Error

Solution code:
s = list(input())
if (s[0] == "A") and (s[2:-1].count("C")==1):
    s[0] = "a"
    s[s[2:-2].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: Runtime Error

Solution code:
s = list(input())
if len(s)
if (s[0] == "A") and (s[2:-2].count("C")==1):
    print("aa")
    s[0] = "a"
    s[s[2:-2].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: Runtime Error

Solution code:
s = list(input())
if (s[0] == "A") and (s[2:-1].count("C")):
    print("aa")
    s[0] = "a"
    s[s[2:-2].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: Runtime Error

Solution code:
S = input()
cnt = S[2:-1].count('C')

if 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: Runtime Error

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

Submission status: Runtime Error

Solution code:
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: Runtime Error

Solution code:
s = input()
flg = True
if(s[0] != "A"):
    flg = False
if(s[2:-1].count("C")!=1):
    flg = False
for i in range(1, len(s)):
    if(s[i] == "C" and i !=len(s)-1):
        continue
    if(s[i].isupper()):
        flg = False

print("AC" if Flg else "WA")

Submission status: Runtime Error

Solution code:
N = int(input())

for i in range(100):
    if N-7*i >=0 and (N -(7 * i)) % 4 == 0:
        print("Yes")
        exit()
        
else:
    print("No")

Submission status: Runtime Error

Solution code:
"""
author : halo2halo
date : 23, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

S = readline().decode('utf8').rstrip()
lis = list(S)
# print(lis)
print(lis.index('C'))
print(len(lis))
if lis[0] == 'A' and 2 <= lis.index('C') <= len(lis) - 2:
    st = ''.join(lis[1:lis.index('C')] + lis[lis.index('C') + 1:])
    # print(st)
    if st.lower():
        print('AC')
    else:
        print('WA')

else:
    print('WA')

Submission status: Runtime Error

Solution code:
"""
author : halo2halo
date : 23, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

S = readline().decode('utf8').rstrip()
lis = list(S)
# print(lis)
if lis[0] == 'A' and 2 <= lis.index('C') <= len(lis) - 1:
    st = ''.join(lis[1:lis.index('C')] + lis[lis.index('C') + 1:])
    # print(st)
    if st.lower():
        print('AC')
    else:
        print('WA')

else:
    print('WA')

Submission status: Runtime Error

Solution code:
"""
author : halo2halo
date : 23, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

S = readline().decode('utf8').rstrip()
lis = list(S)
print(lis)
if lis[0] == 'A' and 2 <= lis.index('C') <= len(lis) - 1:
    st = ''.join(lis[1:lis.index('C')] + lis[lis.index('C') + 1:])
    print(st)
    if st.lower():
        print('AC')
    else:
        print('WA')

else:
    print('WA')

Submission status: Runtime Error

Solution code:
A = list(input())
L = len(A)

ans = 'WA'
flag = 0
f = 0
count = 0
if A[0] == 'A':
    flag = flag + 1

for i in range(2,L-1):
    if A[i] == 'C':
        count = count + 1
        if f == 0:
            j = i
            f = 1
if count == 1:
    flag = flag + 1

count = 0
for i in range(1,L-1):
    if A[i].isupper():
        conut = count + 1
        if i == j:
            count = count - 1
if count == 0:
    flag = flag + 1

if flag == 3:
    ans = 'AC'

print(ans)

Submission status: Runtime Error

Solution code:
 = list(input())
L = len(A)

ans = 'WA'
flag = 0
f = 0
count = 0
if A[0] == 'A':
    flag = flag + 1

for i in range(2,L-1):
    if A[i] == 'C':
        count = count + 1
        if f == 0:
            j = i
            f = 1
if count == 1:
    flag = flag + 1

count = 0
for i in range(1,L-1):
    if A[i].islower():
        conut = count + 1
        if i == j:
            count = count - 1
if count == 0:
    flag = flag + 1

if flag == 3:
    ans = 'AC'
    
print(ans)

Submission status: Runtime Error

Solution code:
s = list(input())

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

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

s.remove('A')
s.remove('C')
if "".join(s).isupper():
    ans = 'WA'

print(ans)

Submission status: Runtime Error

Solution code:
S = list(input())
last = len(S) - 1

S_head = S[0]

S_clone = S
S_bothEnd = [S[0],S[1],S[last]]
S_center = list(set(S)-set(S_bothEnd))

S_clone.remove('A')
S_clone.remove('C')

evalLow = "".join(S_clone)

if S_head == "A" and S_center.count("C")  == 1 and evalLow.islower() == 1:
  print('AC')
else:
  print('WA')

Submission status: Runtime Error

Solution code:
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))


s = list(input())
ans = True
li = list("abcdefghijklmnopqrstuvwxyzC")

if s[0]!="A":
    ans = False
memo = s[2:-1]
if not("C" in memo):
    ans = False
C_cnt = 0
for i in range(1,len(li)):
    if not(memo[i] in li):
        ans = False
    if memo[i] == "C":
        C_cnt += 1

if ans and C_cnt==1:
    print("AC")
else:
    print("WA")

Submission status: Runtime Error

Solution code:
s=input()
ans="AC"
if s[0]!="A":
    ans="WA"
c=0
idx=0
for i in range(2,len(s)-2):
    if s[i]=="C":
        c+=1
        idx=i
if c!=1:
    ans="WA"
small={"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"}
for i in range(1,len(s)+1):
    if i!=idx:
        if s[i] not in small:
            ans="WA"
            break
print(ans)

Submission status: Runtime Error

Solution code:
import sys

s = input()

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

if s[1] < "a" or s[1] > "z":
    print("WA")
    sys.exit(1)


sub = s[2:-1]
has = False
for c in sub:
    if not has and c == "C":
        has = True

    elif "a" <= c <= "z":
        continue

    else:
        has = False
        break

if not has:
    print("wA")
    sys.exit(0)

if "a" <= s[len(s) - 1] <= "z":
    print("AC")
else:
    print("WA")

Submission status: Runtime Error

Solution code:

s=input()
S=list(s)
print(S[2:-2].count('C'))

if S[0]=='A':
    if S[2:-2].count('C')==1:
        buf1=s[1]+s[3:]
        buf2=s[1:-2]+s[-1]
        if buf1.islower() or buf2.islower():
            print('AC')
            sys.exit()
    
print('WA')

Submission status: Runtime Error

Solution code:
S=input()
judge='AC'
cnt = 0

for i in len(S):
    if S[i].isupper():
        if i == 0 or i == len(S) - 2 or S[i] != 'C':
            judge = 'WA'
        cnt+=1

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
yandy
S = input()

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


print('WA')

Submission status: Runtime Error

Solution code:


S = input()

ans = 'WA'

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
s=input()
ss=s[1:-1]

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

Submission status: Runtime Error

Solution code:
S = input()

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

Submission status: Runtime Error

Solution code:
s=input()
must=s[2:-1]

if s[0]=='A':
	if must.count('C')==1:
		for l in s:
  			if l.isupper()==2:
  					print('AC')
                    exit()
print('WA')

Submission status: Runtime Error

Solution code:
s=input()
s_list=list(s)
must=s_list[2:-1]
cnt=0
if s_list[0]=='A':
  cnt+=1
if must.count('C')==1:
  cnt+=1
s_list.remove('A')
s_list.remove('C')
k=''.join(s_list)
if k.islower():
  cnt+=1
if cnt==3:
  print('AC')
else:
  print('WA')

Submission status: Runtime Error

Solution code:
s=input()
s_list=list(s)
must=s_list[2:-1]
cnt=0
if s_list[0]=='A':
  cnt+=1
if must.count('C')==1:
  cnt+=1
s_list.remove('A')
s_list.remove('C')
k=''.join(s_list)
if k.islower():
  cnt+=1
if cnt==3:
  print('AC')
else:
  print('WA')

Submission status: Runtime Error

Solution code:
s=input().split()
must=s[2:-1]
cnt=0
if s[0]=='A':
  cnt+=1
if must.count('C')==1:
  cnt+=1
s.remove('A')
s.remove('C')
if s.islower():
  cnt+=1
if cnt==3:
  print('AC')
else:
  print('WA')

Submission status: Runtime Error

Solution code:
s=input()
must=s[2:-1]
cnt=0
if s[0]=='A':
  cnt+=1
if must.count('C')==1:
  cnt+=1
s.remove('A')
s.remove('C')
if s.islower():
  cnt+=1
if cnt==3:
  print('AC')
else:
  print('WA')

Submission status: Runtime Error

Solution code:
s=[int(x) for x in input().split()]
must=s[2:-1]
cnt=0
if s[0]=='A':
  cnt+=1
if must.count('C')==1:
  cnt+=1
s.remove('A')
s.remove('C')
if s.islower():
  cnt+=1
if cnt==3:
  print('AC')
else:
  print('WA')

Submission status: Runtime Error

Solution code:
s=[int(x) for x in input().split()]
must=s[2:-1]
cnt=0
if s[0]=='A':
  cnt+=1
if must.count('C')=1:
  cnt+=1
s.remove('A')
s.remove('C')
if s.islower():
  cnt+=1
if cnt==3:
  print('AC')
else:
  print('WA')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
inp = input()
remain = inp[1:-2] + inp[-1]
if inp[0] == "A" && inp[-2] == "C":
  if remain.islower():
    return "AC"
return "WC"

Submission status: Runtime Error

Solution code:
import sys

s = input()
if s[0] == "A" and s.count("C") == 1 and "C" in s[2:-1]:
    ss = set(s)
    ss.remove("A")
    ss.remove("C")
    SS = [i.upper() for i in ss]
    if len(ss & SS) == 0:
        print("AC")
        sys.exit()

print("WA")

Submission status: Runtime Error

Solution code:
def is_upper_case(s):
  return not (ord('a') <= ord(s) <= ord('z'))

S = input()

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

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

upper_num = map(is_upper_case, S).count(True)

if upper_num != 2: # expected only 'A', 'C'
  print("WA")
  exit()

print("AC")

Submission status: Runtime Error

Solution code:
S=list(input())
for i in range(2,len(S)-2):
  if S[0]=="A" and S[i]=="C" and S.count("C")==1:
    A="AC"
    break
  else:
    A=0
if A =="AC":
  print(A)
else:
  print("WC")

Submission status: Runtime Error

Solution code:
S = list(input())

ac = False
if S[0] == "A":
    if S[2:len(S)-1].count("C") == 1:
        ac = True

 upper = False
 count = 0
for i in S[2:len(S)-1]:
    if i.isupper():
        count += 1

if count == 1:
    upper = True

if ac and upper:
    print("AC")
else:
    print("WA")

Submission status: Runtime Error

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

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

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

S.remove('C')
S.remove('A')

for i in S:
    if i not in 'abcdefghizklmnopqrstuvwxyz':
        exit('WA')


print('AC')

Submission status: Runtime Error

Solution code:
import sys
s=list(input())
if s[0]!='A':
    break
count=0
for i in range(2,len(s)-2):
    if s[i]=='C':
        count+=1

if count==1:
    s.remove('A')
    s.remove('C')    
    res=''.join(s)
    print('AC' if res.islower()==True else 'WA') #str.islower():全部小文字ならTrue

else:
    print('WA')

Submission status: Runtime Error

Solution code:
n=input()
wa=0
#print(n[2:len(n)-1])
if n[0]=="A" and n[2:len(n)-1].count("C")==1 and n[1]!="C" and n[len(n)]!="C":
    wa+=0
    import re
    a=re.sub('[AC ]', '',n)
else:
    wa+=1
    a=n
for i in range(len(a)):
    if 0<= ord(a[i]) - ord('a') <= 26:
        wa+=0
    else:
        wa+=1
if wa==0:
    print("AC")
else:
    print("WA")

Submission status: Runtime Error

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

    for i in range(len(S)):
        if i != 0 and i != C_index:
            if S[i].isupper():
                return False

    return True

S = input()

print('AC' if is_target_string(S) else 'WA')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

S = IS()
if S[0] == "A" and S[2] == "C" and islower(S[1])==True  and islower(S[3:]):
    print("AC")
else:
    print("WA")

Submission status: Runtime Error

Solution code:
S = list(input())

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

Submission status: Runtime Error

Solution code:
def test():
    s = input()
    a = []
    count = 0
    if s[0].isupper():
        for i in range(2,len(s)-1):
            if s[i] == "C":
                a.append(i)
                count += 1

    s2 = list(s)
    for i in a:
        s2.remove(s2[i])

    s3 = "".join(s2[1:])

    if count == 1 and s3.islower():
        print("AC")
    else:
        print("WA")


if __name__ == "__main__":
    test()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = list(input())

ans = "AC"

if S[0] != "A":
  ans = "WA"
  
count = 0
for item in S[2:-2]:
  if item == "C":
    count += 1
    
if count != 1:
  ans = "WA"
  
S.remove("A")
S.remove("C")

if "".join(S).lower() != "".join(S):
  ans = "WA"

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

if len(S) == 4:
    if S[2] == 'C':
        score += 1

    for i,v in enumerate(S):
        if i != 0 and i !=2: 
            v.islower() == True:
                score += 1

else:
    if S[2] == 'C' and S[-2] != 'C':
        score += 1

    elif S[2] != 'C' and S[-2] == 'C':
        score += 1

    for i,v = enumerate(S):
        if i != 0 and i != 2 and i != len(S)-2:
            v.islower() == True:
                score += 1

if score == 3:
    print("AC")
else:
    print("WA")

Submission status: Runtime Error

Solution code:
from collections import Counter

def main():

    S = list(input())
    head = S.pop(0)
    cList = []
    flag  = False
    flag1 = False
    flag2 = False

    if head == 'A':
        flag = True
    
    for i,j in enumerate(S[1:-2]):
        if j=='C':
            cList=S.pop(i+1)
    if len(cList)==1:
        flag1=True
    
    if ''.join(S).islower():
        flag2 = True
    
    if flag and flag1 and flag2:
        print('AC')
    else:
        print('WA')


    
if __name__== "__main__":
    main()

Submission status: Runtime Error

Solution code:
from collections import Counter

def main():

    S = list(input())
    head = S.pop(0)
    cList = []
    flag  = False
    flag1 = False
    flag2 = False

    if head == 'A':
        flag = True
    
    for i,j in enumerate(S[1:-2]):
        if j=='C':
            cList=S.pop(i)
    if len(cList)==1:
        flag1=True
    
    if ''.join(S).islower():
        flag2 = True
    
    if flag and flag1 and flag2:
        print('AC')
    else:
        print('WA')


    
if __name__== "__main__":
    main()

Submission status: Runtime Error

Solution code:
S = input()
alphabets = set(chr(ord('a')+x) for x in range(26))

f1 = (S[0]=="A")
f2 = (S[2:-1].count("C")==1)
f3 = (set(S)-set("AC")<=alphabets)

answer = 'AC' if bl1 and bl2 and bl3 else 'WA'
print(answer)

Submission status: Runtime Error

Solution code:
s=input()

if s[0]=='A':
    if s[2:-1].count('C')==1:
        index=s[2:-1].index('C')
        if tmp==tmp.lower():
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=input()
ans="AC"
cnt1=0
cnt2=0
cnt3=0
for i in range(len(s)):
    if i==0:
        if s[i]!="A":
            ans="WA"
    if i==1:
        cnt1+=s[i].isupper()*1
    if i>=2:
        if i==len(s)-1:
            if s[i]=="C":
                ans="WA"
        elif s[i]=="C":
            cnt2+=1
        else:
            cnt3+=s[i].isupper()*1
if cnt1!=0 or cnt2!=1 or cnt!=0:
    ans="WA"
print(ans)

Submission status: Runtime Error

Solution code:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)

    # N の逆元
    # N_inv = pow(N,MOD-2,MOD)

    # nCr
    # Nの階乗 * rの階乗の逆元 * n-rの階乗の逆元
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")

    # 大きな素数
    MOD = 10**9+7
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    S = list(_ for _ in input())
    # print(S)
    if S[0] != 'A':        
        print('WA')
        return
    S.pop(0)
    # print(S)
    if S[1:-1].count('C') != 1:
        print('WA')
        return
    S.pop(S.index('C',1,-2))
    # print(S)
    for s in S:
        if s.isupper():
            print('WA')
            return
    print('AC')
    return
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
S=input()
ans="WA"
if S[0]=="A" and S[2:-1].count("C")==1:
  s=S.find("C",2,-1)-
  SS=S[1:s]+S[s+1:]
  if SS.islower() is True:
    ans="AC"
print(ans)

Submission status: Runtime Error

Solution code:
(let ((s (read-line)))
  (princ (if (and (char= (char s 0) #\A)
                  (= 1 (count #\C s :start 2 :end (- (length s) 1) :test #'char=))
                  (not (some #'upper-case-p (remove #\C (subseq s 2) :count 1))))
    "AC"
    "WA")))

Submission status: Runtime Error

Solution code:
S = input()
count = 0
answer = "WA"

if S[0] == 'A' and S[2:-1].count('C') == 1:
    C = S.index('C')
    exception = [0]
    exception.append(C)

if len(exception) == 2:
    for j in range(len(S)):
        if j not in exception and S[j].islower():
            count += 1

if count == len(S)-2:
    answer = "AC"
    

print(answer)

Submission status: Runtime Error

Solution code:
S = input()
answer = "WA"

if S[0] == 'A' and S[2:-1].count('C') == 1:
    C = S.index('C')
    exception = [0]
    exception.append(C)

if len(exception) == 2:
    for j in range(len(S)):
        if j not in exception and S[j].islower():
            answer = "AC"

print(answer)