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:
#!/usr/bin/env python3

s = str(input())

flag = 1
if s[0] != "A":
    flag = 0
if s[2] != "C":
    flag = 0


num_C = 0
for i in s[1:-1]:
    if i == "C":
        num_C += 1
if num_C >= 2 or num_C == 0:
    flag = 0

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

Submission status: Wrong Answer

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

s = str(input())

flag = 1
if s[0] != "A":
    flag = 0
if s[2] != "C":
    flag = 0


num_C = 0
for i in s[1:]:
    if i == "C":
        num_C += 1
if num_C >= 2 or num_C == 0:
    flag = 0

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

Submission status: Wrong Answer

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

s = str(input())

flag = 1
if s[0] != "A":
    flag = 0
if s[2] != "C":
    flag = 0


num_C = 0
for i in s[1:]:
    if i == "C":
        num_C += 1
if num_C >= 2:
    flag = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
if s[0]  == 'A' and s[1:-1].count('C') == 1:
    for n in s[1:]:
        if n.islower():
            continue
        else:
            if n == 'C':
                continue
            else:
                print('WA')
                exit()
else:
    print('WA')
    exit()
print('AC')

Submission status: Wrong Answer

Solution code:
s=input()
res="AC"
if s[0]!="A":res="WA"
elif s[2:-2].count("C")!=1:res="WA"
else:
    li=list(s)
    li.remove("A")
    li.remove("C")
    for i in li:
        if i!=i.lower():
            res="WA"
print(res)

Submission status: Wrong Answer

Solution code:
s=input()
res="AC"
if s[0]=="A":res="WA"
elif s[2:-2].count("C")!=1:res="WA"
elif "A" in s and "C" in s[2:-2]:
    li=list(s)
    li.remove("A")
    li.remove("C")
    for i in li:
        if i!=i.lower():
            res="WA"
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import re
S = input()
print('AC' if S.startswith('A') and (S[2] + S[-3:][0]).count('C') == 1 and len(re.findall('[A-Z]', S)) == 2 else 'WA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
import heapq
from fractions  import gcd
#input=sys.stdin.readline
#import bisect
s=input()
c=False
if s[0]=="A":
    for i in range(1,len(s)):
        if s[i]!="C" and s[i].isupper():
            print("WA")
            break
        elif s[i]=="C" :
            if c==False and 2<=i<=len(s)-2:
                c=True

            else:
                print("WA")
                break
    else:
      if  c:
        print("AC")
      else:
        print("WA")

Submission status: Wrong Answer

Solution code:
S = input()
sl = []
ans = 'AC'

for i in S:
    sl.append(i)
if sl[0] != 'A':
    ans = 'WA'
if sl[2:-1].count('C') != 1:
    ans = 'WA'
    
#print(sl)
#print(sl[2:-1])
print(ans)

Submission status: Wrong Answer

Solution code:
S = str(input())
    
result = False
    
if S[0] == 'A':
    
    check = S[2:len(S)-2]
    
    if check.count('C') == 1:
        
        result = S[1:]
        
        result = result.replace('C','')
        
        if result.islower():
            result = True
            
if result:
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
S = str(input())
    
result = False
    
if S[0] == 'A':
    
    check = S[2:len(S)-1]
    
    if check.count('C') == 1:
        
        result = S[1:]
        
        result = result.replace('C','')
        
        if result.islower():
            result = True
            
if result:
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
S = str(input())
    
result = False
    
if S[0] == 'A':
    
    check = S[1:len(S)-1]
    
    if check.count('C') == 1:
        
        result = check[1:]
        
        result = result.replace('C','')
        
        if result.islower():
            result = True
            
            
            
            
if result:
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
S = str(input())
    
result = False
    
if S[0] == 'A':
    
    check = S[2:len(S)-1]
    
    if check.count('C') == 1:
        
        result = check[1:]
        
        result = result.replace('C','')
        
        if result.islower():
            result = True
            
            
            
            
if result:
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
# abc104_b.py
# https://atcoder.jp/contests/abc104/tasks/abc104_b

# B - AcCepted /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 200点

# 問題文
# 文字列 Sが与えられます。S のそれぞれの文字は英大文字または英小文字です。 Sが次の条件すべてを満たすか判定してください。
#     Sの先頭の文字は大文字の A である。
#     Sの先頭から 3 文字目と末尾から 2 文字目の間（両端含む）に大文字の C がちょうど 1個含まれる。
#     以上の A, C を除く Sのすべての文字は小文字である。

# 制約
#     4≤|S|≤10（|S| は文字列 Sの長さ）
#     Sのそれぞれの文字は英大文字または英小文字である。

# 入力
# 入力は以下の形式で標準入力から与えられる。
# S

# 出力
# Sが問題文中の条件すべてを満たすなら AC、そうでなければ WA と出力せよ。

# 入力例 1
# AtCoder

# 出力例 1
# AC

# 1文字目が A、3文字目が C でそれ以外の文字はすべて小文字であり、すべての条件を満たします。

# 入力例 2
# ACoder

# 出力例 2
# WA

# 2文字目が C であってはいけません。

# 入力例 3
# AcycliC

# 出力例 3
# WA

# 最後の文字が C であってもいけません。

# 入力例 4
# AtCoCo

# 出力例 4
# WA

# C を 2個以上含んではいけません。

# 入力例 5
# Atcoder

# 出力例 5
# WA

# C を 1個も含まないのもいけません。


def calculation(lines):
    S = lines[0]
    n_c = 0
    n_l = 0
    for i in range(len(S)):
        if S[i] == 'C':
            n_c += 1
        if S[i] < 'a':
            n_l += 1
    if S[0] != 'A':
        ret = 'WA'
    elif S[1] == 'C':
        ret = 'WA'
    elif S[-1] == 'C':
        ret = 'WA'
    elif n_c != 1:
        ret = 'WA'
    elif n_l != 2:
        print(n_l)
        ret = 'WA'
    else:
        ret = 'AC'
    return [ret]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['AtCoder']
        lines_export = ['AC']
    if pattern == 2:
        lines_input = ['ACoder']
        lines_export = ['WA']
    if pattern == 3:
        lines_input = ['AcycliC']
        lines_export = ['WA']
    if pattern == 4:
        lines_input = ['AtCoCo']
        lines_export = ['WA']
    if pattern == 5:
        lines_input = ['Atcoder']
        lines_export = ['WA']
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode


# 主処理
def main():
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

# S = 'AaCa'

b = True
b = b and (S[0]=='A')
b = b and ( S[2:-1].count('C')==1 )

b = b and ( 'a' <= S[1] <= 'z')
b = b and ( 'a' <= S[-1] <= 'z')

for c in S[3:-2]:
  b = b and ( 'a' <= c <= 'z' )

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

Submission status: Wrong Answer

Solution code:
S = input()

# S = 'AaCa'

b = True
b = b and (S[0]=='A')
b = b and ( S[2:-1].count('C')==1 )

b = b and ( 'a' <= S[1] <= 'z')
b = b and ( 'a' <= S[-1] <= 'z')

for c in S[4:-2]:
  b = b and ( 'a' <= c <= 'z' )

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

Submission status: Wrong Answer

Solution code:
s = input()

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

s = s.lstrip("A")

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

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

s = s.replace("C", "", 1)

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

Submission status: Wrong Answer

Solution code:
s = input().rstrip()

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

f = False
for i in range(1, len(s)):
    if s[i] == 'C':
        if i < 2 or i >= len(s) - 2:
            print('WA')
            exit(0)
        if f:
            print('WA')
            exit(0)
        f = True
    elif not str.islower(s[i]):
        print('WA')
        exit(0)

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

Submission status: Wrong Answer

Solution code:
s = input().rstrip()

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

f = False
for i in range(len(s)):
    if s[i] == 'C':
        if i < 2 or i >= len(s) - 2:
            print('WA')
            exit(0)
        if f:
            print('WA')
            exit(0)
        f = True
    elif not str.islower(s[i]):
        print('WA')

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

Submission status: Wrong Answer

Solution code:
s = input().rstrip()

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

f = False
for i in range(2, len(s) - 1):
    if s[i] == 'C':
        if f:
            print('WA')
            exit(0)
        f = True
    elif not str.islower(s[i]):
        print('WA')
        exit(0)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())

if S[0] == 'A':
  isC = 0
  for i in S[2:len(S)]:
    if i == 'C':
      isC += 1
  else:
    if isC == 1:
      for i in range(len(S)):
        if S[i] == 'A' or S[i] =='C' or S[i].islower():
          pass
        else:
          print('WA')
          break
      else:
        print('AC')
    else:
      print('WA')
else:
  print('WA')

Submission status: Wrong Answer

Solution code:
import sys
s = input()

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

# Aが頭にあってCは一つしかない
for i,c in enumerate(s):
    if i != 0 and i!=s[2:-2].index("C")+2:
        if ord(c) <= 90:
            print("WA")
            sys.exit()

print("AC")

Submission status: Wrong Answer

Solution code:
s = input()
ans = True

if s[0] != 'A':
    ans = False
    print(f's[0]:{s[0]}')

index = -1
between_bigin_3_and_end_2 = s[2:-1]
count = between_bigin_3_and_end_2.count('C')
if count == 1:
    index = s.index('C')
    # print(index)
else:
    ans = False
    # print(f'between_bigin_3_and_end_2:{between_bigin_3_and_end_2}')
    # print(f'count:{count}')

    
for i in range(len(s)):
    if i == 0:
        continue
    if i == index:
        continue
    if not s[i].islower():
        ans = False


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

Submission status: Wrong Answer

Solution code:
s = input()
ans = True

if s[0] != 'A':
    ans = False
    print(f's[0]:{s[0]}')

index = -1
between_bigin_3_and_end_2 = s[2:-1]
count = between_bigin_3_and_end_2.count('C')
if count == 1:
    index = s.index('C')
    # print(index)
else:
    ans = False
    print(f'between_bigin_3_and_end_2:{between_bigin_3_and_end_2}')
    print(f'count:{count}')

    
for i in range(len(s)):
    if i == 0:
        continue
    if i == index:
        continue
    if not s[i].islower():
        ans = False


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

Submission status: Wrong Answer

Solution code:
s = input()
ans = True

if s[0] != 'A':
    ans = False
# print(s.count('C'))
index = -1
if s[2:-2].count('C') == 1:
    index = s.index('C')
    # print(index)
else:
    ans = False

    
for i in range(len(s)):
    if i == 0:
        continue
    if i == index:
        continue
    if not s[i].islower():
        ans = False


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

Submission status: Wrong Answer

Solution code:
s = input()
ans = True

if s[0] != 'A':
    ans = False
# print(s.count('C'))
index = -1
if s[2:-2].count('C') == 1:
    index = s.index('C')
    # print(index)
else:
    ans = False

    
for i in range(len(s)):
    if i == 0:
        continue
    if i == index:
        continue
    if not s[i].isupper():
        ans = False


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

Submission status: Wrong Answer

Solution code:

S = list(input()) #１文字ずつ
N = len(S)
al=[chr(ord('a') + i) for i in range(26)]
# print('al:',al)

flag=0
if S[0]!='A':
    print('A')
    flag=1

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

    # print('count:',count)
    if count==1:
        for i in range(N):
            if S[i]!='A' and S[i]!='C':
                if S[i] not in al:
                    flag=1

    else:
        flag=1

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

Submission status: Wrong Answer

Solution code:
S = input()

ans = "WA"

if S[0] == "A":
    if S.count("C") == 1:
        if "C" in S[2:-1]:
            ans = "AC"

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

ans = "WA"

if S[0] == "A":
    ans = "AC"

if S.count("C") == 1:
    if "C" in S[2:-1]:
        ans = "AC"

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

ans = "AC"

if S[0] == "A":
    pass
else:
    ans = "WA"

if S[2] == "C" and S[-2] == "C":
    ans = "WA"
elif S[2] == "C" or S[-2] == "C":
    pass
else:
    ans = "WA"

print(ans )

Submission status: Wrong Answer

Solution code:
"""
1. The initial character of S is an uppercase A.
2. There is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).
3. All letters except the A and C mentioned above are lowercase.
"""
import collections
def a(r): return r[0] == 'A'
def b(r): return collections.Counter(r[1:-2])['C'] == 1
def c(r): return all([l in set(['A', 'C']) or l.lower() ==l for l in r ])
def f(r):  return a(r) and b(r) and c(r)

print 'AC' if f(raw_input()) else 'WA'

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし

S = LS2()

if not (S.count('C') == 1 and S[0] == 'A' and S[1] != 'C' and S[-1] != 'C'):
    print('WA')
else:
    for i in range(1,len(S)):
        if not (S[i] == 'C' or S[i].islower()):
            print('WA')
            exit()
print('AC')

Submission status: Wrong Answer

Solution code:
import sys
s = input()

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

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

if c != 1 :
  print("WA")
  sys.exit()

for i in range(len(s)):
  if s[i] != "A" and s[i] != "C":
    if ord(s[i]) < 97  or  122 < ord(s[i]):
      print("WA")
      sys.exit()
 
print("AC")

Submission status: Wrong Answer

Solution code:
s=input()
n=len(s)
f=True
if s[0]!='A':
    f=False
if s[2:n-1].count('C')!=1:
    f=False
for ss in s:
    if ss!='A' and s!='C' and s.isupper():
        f=False
print('AC' if f else 'WA')

Submission status: Wrong Answer

Solution code:
S = list(input())
l = [chr(i) for i in range(65, 65+26)]

flag = True
if not 'C' in S[2:len(S) - 2]:
    flag = False
    if len(S) == 4:
        if S[2] == 'C':
            flag = True
elif S[0] != 'A':
    flag = False
elif S[1] in l:
    flag = False
if S[len(S) - 1] in l:
    flag = False
count = 0
for i in range(2, len(S) - 1):
    if flag == False:
        break
    if S[i] in l:
        count += 1
    if count > 1:
        flag = False
if count < 1:
    flag = False
if flag:
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
S = list(input())
l = [chr(i) for i in range(65, 65+26)]

flag = True
if S[0] != 'A':
    flag = False
elif S[1] in l:
    flag = False
elif S[len(S) - 1] in l:
    flag = False
elif not 'C' in S[2:len(S) - 2]:
    flag = False
if len(S) == 4:
    if S[2] == 'C':
        flag = True
count = 0
for i in range(2, len(S) - 1):
    if flag == False:
        break
    if S[i] in l:
        count += 1
    if count > 1:
        flag = False
if count < 1:
    flag = False
if flag:
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
S = list(input())
l = [chr(i) for i in range(65, 65+26)]

flag = True
if S[0] != 'A':
    flag = False
elif S[1] in l:
    flag = False
elif S[len(S) - 1] in l:
    flag = False
elif not 'C' in S[2:len(S) - 2]:
    flag = False
count = 0
for i in range(2, len(S) - 1):
    if flag == False:
        break
    if S[i] in l:
        count += 1
    if count > 1:
        flag = False
if count < 1:
    flag = False
if flag:
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
ans = 1
if s[0] != "A":
    ans *= 0
check = 0
for i in range(1, n):
    if s[i] == "C" and check == 0:
        check = 1
    elif s[i] == "C":
        check = 0
    else:
        if 97 <= ord(s[i]) <= 122:
            ans *= 1
        else:
            ans *= 0
if s[-1] == "C" or s[1] == "C":
    ans *= 0
print(["WA", "AC"][ans * check])

Submission status: Wrong Answer

Solution code:
print("a", ord("a"))
print("z", ord("z"))

s = input()
n = len(s)
ans = 1
if s[0] != "A":
    ans *= 0
check = 0
for i in range(1, n):
    if s[i] == "C" and check == 0:
        check = 1
    elif s[i] == "C":
        check = 0
    else:
        if 97 <= ord(s[i]) <= 122:
            ans *= 1
        else:
            ans *= 0
if s[-1] == "C" or s[1] == "C":
    ans *= 0
print(["WA", "AC"][ans * check])

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
ans = 1
if s[0] != "A":
    ans *= 0
check = 0
for i in range(1, n):
    if s[i] == "C" and check == 0:
        check = 1
    elif s[i] == "C":
        check = 0
    else:
        if 97 <= ord(s[i]) <= 122:
            ans *= 1
        else:
            ans *= 0
print(["WA", "AC"][ans * check])

Submission status: Wrong Answer

Solution code:
print("a", ord("a"))
print("z", ord("z"))

s = input()
n = len(s)
ans = 1
if s[0] != "A":
    ans *= 0
check = 0
for i in range(1, n):
    if s[i] == "C" and check == 0:
        check = 1
    elif s[i] == "C":
        check = 0
    else:
        if 97 <= ord(s[i]) <= 122:
            ans *= 1
        else:
            ans *= 0
print(["WA", "AC"][ans * check])

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
ans = 1
if s[0] != "A":
    ans *= 0
check = 0
for i in range(n):
    if s[i] == "C" and check == 0:
        check = 1
    elif s[i] == "C":
        check = 0
    else:
        if 97 <= ord(s[i]) <= 122:
            ans *= 1
        else:
            ans *= 0
print(["WA", "AC"][ans * check])

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
s=input()
if s[0] == 'A' and 1 < s.find('C') < len(s) - 2 and (s[1:s.index('C')]+s[s.index('C')+1:]).islower():
    print("AC")
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

S = list(input().rstrip('\n'))
# print(S[2:-1])
if S[0] == 'A' and S[2:-1].count('C') == 1:
    S.remove('A')
    S.remove('C')
    S = ''.join(S)
    # print(S)
    if S.islower:
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

S = list(input().rstrip('\n'))
# print(S[:3])
# print(S[-2:])
if S[0] == 'A' and S[2:-1].count('C') == 1:
    S.remove('A')
    S.remove('C')
    S = ''.join(S)
    # print(S)
    if S.islower:
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
s=input()
n=len(s)
ans=1
if s[0]!="A":
  ans *= 0
check=0
for i in range(n):
  if s[i]=="C" and check==0:
    check=1
  elif s[i]=="C":
    check=0
print(["WA","AC"][ans*check])

Submission status: Wrong Answer

Solution code:
S=input();n=len(S)
print('AC'if(S[0]=='A'and S[2:-2].count('C')==1 and len([i for i in range(n)if 96<ord(S[i])])==n-2)else'WA')

Submission status: Wrong Answer

Solution code:
import sys
S = input()

if S[0] is 'A':
    S = S[1:]
    try:
        num = S.index('C')
    except:
        print('WA')
        sys.exit()
    num0 = len(S)
    if 1 <= num < len(S)-2:
        S = S.replace('C', '')
        if len(S)+1 != num0:
            print('WA')
            sys.exit()
        for i in S:
            if i.isupper():
                print('WA')
                sys.exit()
    else:
        print("WA")
        sys.exit()
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
import sys
S = input()

if S[0] is 'A' and S[2:-2].count('C') == 1:
    S = S[1:]
    num = S.index('C')
    if num < 1:
        print('WA')
        sys.exit()
    for i, j in enumerate(S):
        if i == num or j.islower():
            continue
        else:
            print('WA')
            sys.exit()
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
import sys
S = input()

if S[0] is 'A' and S[2:-2].count('C') == 1:
    S = S[1:]
    num = S.index('C')
    for i, j in enumerate(S):
        if i == num or j.islower():
            continue
        else:
            print('WA')
            sys.exit()
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0
inf = float("inf")

S = X()
if S[0] != "A" or S[2] != "C":
    print("WA")
    sys.exit()

S.remove(S[0])
S.remove(S[1])

S = "".join(S)

if str.islower(S):
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')


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

t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()




"""

4
1 2
2 4
1 3
3
2 2 4
4 5 6

6
1 2
2 3
3 4
4 5
4 6
3
3 5 6
2 17 31 5 11

"""

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')


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

t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()




"""

4
1 2
2 4
1 3
3
2 2 4
4 5 6

6
1 2
2 3
3 4
4 5
4 6
3
3 5 6
2 17 31 5 11

"""

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if not ( 4 <= len(S) <= 10 ):
    sys.exit()
if len(re.findall('[A-Z]',S)) != 2:
    print('WA')
    sys.exit()

result = 0
if array_S[0] != 'A': result += 1
if array_S[2:-2].count('C') != 1: result += 1 
array_S.pop(0)
array_S.pop(array_S.index('C'))
if not "".join(array_S).islower(): result += 1 

print('WA') if result != 0 else print('AC')

Submission status: Wrong Answer

Solution code:
s=list(input())
res = "AC"
if s[0]!="A" or s[2:-2].count("C")!=1:res="WA"
else:
    s.remove("A")
    s.remove("C")
    s="".join(s)
    if s.lower()!=s :res ="WA"
print(res)

Submission status: Wrong Answer

Solution code:
s=list(input())
res = "AC"
if s[0]!="A" or not "C" in s[2:-2]:res="WA"
else:
    s.remove("A")
    s.remove("C")
    s="".join(s)
    if s.lower()!=s :res ="WA"
print(res)

Submission status: Wrong Answer

Solution code:
s = input()
length = len(s)
count = 0
count_large = 0
sep = s[2:length-2]


if s[0] == 'A':
    count += 1

if sep.count('C') == 1:
    count += 1

for i in range(length):
    if s[i].isupper():
        count_large += 1
        
if count_large == 2:
    count += 1

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

Submission status: Wrong Answer

Solution code:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

s = s()

flag = 0
if s[0] == "A":
	s = s.replace("A","",1)
	for i in range(1,len(s)-2):
		if s[i] == "C":
			s = s.replace("C","",1)
			flag += 1
			break
	if s.islower() and flag == 1:
		print("AC")
	else:
		print("WA")
else:
	print("WA")

Submission status: Wrong Answer

Solution code:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

s = s()

flag = 0
if s[0] == "A":
	s = s.replace("A","",1)
	for i in range(3,len(s)-2):
		if s[i] == "C":
			s = s.replace("C","",1)
			flag += 1
			break
	if s.islower() and flag == 1:
		print("AC")
	else:
		print("WA")
else:
	print("WA")

Submission status: Wrong Answer

Solution code:
s=input()
ans='AC'
if s[0]!='A':
  ans='WA'
s=s[1:]
if s[1:-1].count('C')!=1:
  ans='WA'
s=s.replace('C','c')
for i in s:
  if i.islower==False:
    ans='WA'
    break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
ans = 'WA'
if s[0] == 'A' and 'C' in s[2:len(s)-1]:
  s = s.replace('A', '').replace('C', '')
  if all([i in [chr(i) for i in range(97, 97+26)] for i in s]):
    ans = 'AC'
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
ans = 'No'
if s[0] == 'A' and 'C' in s[2:len(s)-1]:
  s = s.replace('A', '').replace('C', '')
  if all([i in [chr(i) for i in range(97, 97+26)] for i in s]):
    ans = "Yes"
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
ans = "WA"

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

Submission status: Wrong Answer

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

print("WA")