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:
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,-1))
    # print(S)
    for s in S:
        if s.isupper():
            print('WA')
            return
    print('AC')
    return
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()
Count = 0

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

else:
    if S[1].isupper() or S[-1].isupper():
        print('WA')
    else:
        for i in S[2:]:
            if i.isupper():
                if Count==0 and i == 'C':
                    Count += 1
                else:
                    print('WA')
                    exit()
        if Count == 1:
            print('AC')
        else:
            print('WA')

Submission status: Accepted

Solution code:
s=input()
s2=s.replace("A","").replace("C","")
print("WAAC"[s2==s2.lower()and s[0]=="A"and s[2:-1].count("C")==1::2])

Submission status: Accepted

Solution code:
S = list(input())
syo = 'abcdefghijklmnopqrstuvwxyz'
syo = list(syo)
check = 0
if S[0] == 'A':
    pass
else:
    check = 1

tmp = S[2:-1]
if tmp.count('C') == 1:
    iii = S.index('C')
    for i in range(len(S)):
        if i == 0 or i == iii:
            pass
        else:
            if S[i] in syo:
                pass
            else:
                check = 1
else:
    check = 1



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

Submission status: Accepted

Solution code:
S = input()
ac = 1
if S[0] != 'A':
    ac = 0
c = 0
for i in range(1,len(S)):
    if 2 <= i <= (len(S) - 2) and S[i] == 'C':
        c += 1
        continue
    if S[i].isupper():
        ac = 0
if c == 1 and ac:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
# ABC  104 B, accepted
from collections import Counter

S = input()
if S[0] == 'A':
    t = Counter(S[2:-1])
    if t['C'] == 1:
        S=S.replace('A', '')
        S=S.replace('C', '')
        if S.islower():
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = input()

c = 0
for i in S:
    if i.isupper():
        c += 1

if S[0] != 'A' or S[-1].isupper() or c != 2 or 'C' not in S[2:-1]:
    print('WA')
else:
    print('AC')

Submission status: Accepted

Solution code:
S = input()

if S[0] != 'A' or S[-1].isupper():
    print('WA')
    exit()

c = 0
for i in S:
    if i.isupper():
        c += 1

S = S[2:-1]

if c == 2:
    if 'C' in S:
        print('AC')
        exit()

print('WA')

Submission status: Accepted

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

flag = 0
if S[0] == "A":
    s = S[2:N-1]
    if s.count("C") == 1:
        x = S.index("C")
        s1 = S[1:x]
        s2 = S[x+1:]
        S = s1+s2
        if S.islower():
            flag = 1
        else:
            flag = 0
if flag == 1:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s=input()
l=len(s)

if "A" ==s[0] and "C" in s[2:l-1]:
    cnt=0
    for i in list(s):
        if i.isupper():
            cnt+=1

    if cnt==2:
        print("AC")
        exit()
print("WA")

Submission status: Accepted

Solution code:
S = list(input())
isConditionA = S[0] == 'A'
C_count = S[2:len(S) - 1].count('C')
memo = -1
for i in range(0, len(S)):
    if S[i] == 'C' and 1 < i < len(S) - 1:
        memo = i
if memo != -1:
    S.pop(memo)

S.pop(0)
#print(S)
#print(isConditionA,C_count,''.join(S).islower())
if isConditionA and C_count == 1 and ''.join(S).islower():
    print('AC')
else:
    print('WA')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

ans = True
if s[0] == 'A' and s[1].islower() and s[-1].islower() and s[2:len(s) - 1].count('C') == 1:
    for i in range(2, len(s) - 1):
        if s[i].isupper() and s[i] != 'C':
            ans = False
else:
    ans = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
if S[0] != "A":
    print("WA")
    exit()

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

C_index = None
for i, s in enumerate(S[2:-1], 2):
    if s == "C":
        C_index = i
        break

for i, s in enumerate(S[1:], 1):
    if i == C_index:
        continue

    if s.isupper():
        print("WA")
        exit()
print("AC")

Submission status: Accepted

Solution code:
S = input()

editS = S[2:-1:]

if S[0] == 'A' and S[1].islower and editS.count('C') == 1\
    and S[-1].islower():
    S = S.replace('A', '')
    S = S.replace('C', '')
    if S.islower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = list(input())
a = [False, False, False]
count = 0
count1 = 0
if s[0] == "A":
  a[0] = True
for i in s[2:-1]:
  #print(i)
  if i == "C":
    count += 1
#print(count)
if count == 1:
  a[1] = True
for j in range(len(s)):
  if s[j].islower():
    count1 += 1
#print(count1)
if count1 == len(s)-2:
  a[2] = True
#print(a)
if all(a):
  print("AC")
else:
  print("WA")

Submission status: Accepted

Solution code:
S = input()
if S[0] != 'A':
  print('WA')
else:
  cnt = 0
  validate = True
  for i in range(2, len(S)-1):
    if S[i].islower():
      continue
    elif S[i] == 'C':
      cnt += 1
    else:
      validate = False
      break
  if cnt == 1 and validate and S[-1].islower() and S[1].islower() and S[1] != 'C':
    print('AC')
  else:
    print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def check1(s):
    return s[0]=='A'

def check2(s):
    co=0
    for i in s[2:-1]:
        if i=='C':
            co+=1
    return co==1

def check3(s):
    ju=True
    for i in s:
        if i.isupper():
            if i!='A' and i!='C':
                ju=False
                break
    return ju

s=input()
if check1(s) and check2(s) and check3(s):
    print('AC')
else:
    print('WA')

Submission status: Accepted

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

if s[0] == 'A' and subs.count('C') == 1:
    for char in s[1:]:
        if char.isupper() and char != 'C':
            break
    else:
        print("AC")
        exit(0)

print("WA")

Submission status: Accepted

Solution code:
s = input()
if (s[0] == 'A') 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:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()

if S[0] == "A":
	for i in range(2, len(S)-1):
		if S[i] == "C":
			num = i
			s = S[1:num] + S[num+1:]
			if s.islower():
				print("AC")
				os.sys.exit()
print("WA")

Submission status: Accepted

Solution code:
S = input()
count = 0
ans = "WA"
L = []
for k in range(len(S)):
    L.append(S[k])

if L[0] == "A":
    for i in range(2,len(L)-1):
        if L[i] == "C":
            count += 1
            c = i
    if count == 1:
        count2 = 0
        for j in range(len(L)):
            if L[j].islower():
                count2 += 1
        if count2 == len(L)-2:
            ans = "AC"
print(ans)

Submission status: Accepted

Solution code:
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    s = list(input())

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

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

    idx = s[2:-1].index("C") + 2
    l =  s[1: idx] + s[idx+1:]
    for e in l:
        if e.isupper():
            print("WA")
            exit()

    print("AC")

Submission status: Accepted

Solution code:
s = input()

can = True
if s[0] != "A":
    can = False
else:
    cntc = 0
    for c in s[2:-1]:
        if c == "C":
            cntc += 1
    if cntc != 1:
        can = False
    else:
        cntup = 0
        for c in s:
            if c.isupper():
                cntup += 1
        if cntup != 2:
            can = False

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

Submission status: Accepted

Solution code:
a = input()
cIsExist = False

for i in range(len(a)):
    if i == 0:
        if a[i] != "A":
            print("WA")
            exit()
    elif 2 <= i <= len(a)-2:
        if a[i] == "C":
            if not cIsExist:
                cIsExist = not cIsExist
            else:
                print("WA")
                exit()
        else:
            if a[i] != a[i].lower():
                print("WA")
                exit()
    else:
        if a[i] != a[i].lower():
            print("WA")
            exit()
if cIsExist:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()
if s[0] == "A":
  if "C" in s[2:-1]:
    p = s.lstrip("A").split("C")
    if len(p) == 2:
      if p[0].lower() == p[0]:
        if p[1].lower() == p[1]:
          print("AC")
          quit()
print("WA")

Submission status: Accepted

Solution code:
import re
p = re.compile("^A[a-z][a-z]*C[a-z]+$")
s = input()
print("AC" if p.match(s) is not None else "WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
l = len(s)

if s[0] == "A" and "C" in s[2:l-1]:
    ans = 0
    for i in s:
        ans += i.isupper()

    if ans == 2:
        print("AC")
        exit()
print("WA")

Submission status: Accepted

Solution code:
S = input()

length = len(S)

pS1 = S[2: length-1]

if S.startswith('A') and "C" in pS1 and sum(S[i].isupper() for i in range(len(S)))==2:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = list(input())

if s[0]=="A":
    for i in s[2:-1]:
        if i=="C":
            s.sort()
            if s[2].islower():
                print("AC")
                exit()

print("WA")

Submission status: Accepted

Solution code:
s = input()

def validation(s):
    if s[0] != "A":
        return "WA "
    s = s[1:]
    if s[1:-1].count("C") != 1:
        return "WA "
    c = 0
    for i in s:
        if i.islower() != True:
            c += 1
    if c != 1:
        return "WA "
    return "AC"

print(validation(s))

Submission status: Accepted

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

Submission status: Accepted

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

alpha = "BDEFGHIJKLMNOPQRSTUVWXYZ"
s = list(input())
if s[0] != 'A':
    print('WA')
    quit()
if s[2:-1].count('C')!= 1:
    print('WA')
    quit()
for i in range(len(s)):
    if s[i] in alpha:
        print('WA')
        quit()
    elif s[i] == 'A':
        if i != 0:
            print('WA')
            quit()
    elif s[i] == 'C':
        if 0 <= i < 2 or i == len(s)-1:
            print('WA')
            quit()
print('AC')

Submission status: Accepted

Solution code:
S = input()

alphabets = set(chr(ord('a')+x) for x in range(26))

bl1 = (S[0] == 'A')
bl2 = (S[2:-1].count('C') == 1)
bl3 = (set(S) - set('AC') <= alphabets)

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
S = list(input())
uppercase_cnt = 0
for s in S:
    if s.isupper():
        uppercase_cnt += 1 
if S[0] != 'A':
    print('WA')
elif S[2:-1].count('C') != 1:
    print('WA')
elif uppercase_cnt != 2:
    print('WA')
else:
    print('AC')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
flag = True
if s[0] != "A":
    flag = False
c = False
if s[1].isupper() and s[1] != "A" and s[1] != "C":
    flag = False
for i in range(len(s) - 3):
    if s[i + 2] == "C":
        if c:
            flag = False
        c = True
    else:
        if s[i + 2].isupper() and s[i + 2] != "A" and s[i + 2] != "C":
            flag = False

if s[-1].isupper() and s[-1] != "A" and s[-1] != "C":
    flag = False


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

Submission status: Accepted

Solution code:
s = list(input())
ans = 'AC'
tmp = [0]
if s[0] != 'A':
    ans = 'WA'
for i in range(2, len(s)-1):
    if s[i] == 'C':
        tmp.append(i)
if len(tmp) != 2:
    ans = 'WA'
for i in range(len(s)):
    if not i in tmp:
        if not s[i].islower():
            ans = 'WA'
    else:
        pass
print(ans)

Submission status: Accepted

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

if S[0] == 'A' and S[2:-1].count('C') == 1:
    C = S.index('C')
    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: Accepted

Solution code:
#n = int(input())
#h, w = map(int,input().split())
#ls = list(map(int,input().split()))
#ls = [list(map(int,input().split())) for i in range(n)]
#ls = [input() for i in range(h)]
s = input()

if s[0] == "A" and s[2:-1].count("C") == 1:
  ls = list(s)
  ls.remove("A")
  ls.remove("C")
  if str(ls).islower():
    print("AC")
    quit()
print("WA")

Submission status: Accepted

Solution code:
S = input()
cnt_C = 0
length = len(S)
for i, s in enumerate(S):
    if i == 0 and s != "A":
        print("WA")
        exit()
    elif 2 <= i < length - 1:
        if s == "C":
            cnt_C += 1

    if not (s == "A" or s == "C" or "a" <= s <= "z"):
        print("WA")
        exit()

if cnt_C != 1:
    print("WA")
    exit()

print("AC")

Submission status: Accepted

Solution code:
s = list(str(input()))
l = len(s)
if s[0]=="A" and "C" in s[2:l-1]:
    ans=0
    for i in s:
        ans+= i.isupper()
    if ans ==2:
        print("AC")
        exit()
print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
n=len(s)

res='WA'
cnt=0
cnt2=0

if s[0]=='A':
	for i in range(2,n-1):
		if s[i]=='C':
			cnt+=1
	for i in range(1,n):
		if s[i].isupper() and s[i]!='C':
			cnt2+=1
	if cnt==1 and cnt2==0:
		res='AC'
        
print(res)

Submission status: Accepted

Solution code:
def solve(s):
    if s[0] != "A":
        return False

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

    i = 2 + s[2:-1].index("C")
    t = s[1:i] + s[i + 1 :]
    return t == t.lower()


s = input()
print("AC" if solve(s) else "WA")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

if s[0]=='A':
    t = 'a'+s[1:]
    for i in range(2,len(s)-1):
        if s[i]=='C':
            n = i
            u = 'a'+s[1:n]+'c'+s[n+1:]
            if u==s.lower():
                print('AC')
                exit()
print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
s=input()
l=[]
for i in range(2,len(s)-1):
    l.append(s[i])
if l.count("C")!=1:
    print("WA")
    sys.exit()
else:
    k=s[1:s.index("C")]+s[s.index("C")+1:]

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

S = input()
counter = 0
flag = 0

if S[0] == "A":
    if S.find("C", 2, len(S) - 1) != -1:
        counter = S.find("C", 2, len(S) - 1)
        if S[1:counter] == S[1:counter].lower() and S[counter + 1 ::] == S[counter + 1 ::].lower():
            print("AC")
            flag = 1

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

Submission status: Accepted

Solution code:
s = input()

if len(s) >= 4 and len(s) <= 10 and s[0]=="A" and s[2:-1].count("C")==1:
    try:
        ss = list(s[2:-1])
        ss.remove("C")
        ss += s[-1]
        if s[1].islower() and ''.join(ss).islower():
            print("AC")
        else:
            print("WA")
    except:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
string = input()

strlist = list(string)
if strlist[0] != 'A':
	print('WA')
else:
	if 'C' not in strlist[2:-1]:
		print('WA')
	else:
		countA = strlist.count('A')
		countC = strlist.count('C')
		if countA == 1 or countC == 1:
			strlist.remove('A')
			strlist.remove('C')
			string1 = ''.join(strlist)
			if string1.islower():
				print('AC')
			else:
				print('WA')
		else:
			print('WA')

Submission status: Accepted

Solution code:
line = input()
WA_flag = 0
C_flag = 0
check_point = 0

for cnt, elm in enumerate(line):
    if cnt == 0:
        if elm != "A":
            WA_flag += 1
            #print("A_wrong: " + elm)
    if cnt > 1 and cnt < (len(line) - 1):
        if elm =="C":
            C_flag += 1
            check_point = cnt

if C_flag != 1:
    WA_flag += 1
    #print("C_num wrong: " + elm)
else:
    for cnt, elm in enumerate(line):
        if cnt != 0 and cnt != check_point:
            if elm.isupper():
                WA_flag += 1
                #print("upper_wrong: " + elm)

if WA_flag != 0:
    print("WA")
else:
    print("AC")

Submission status: Accepted

Solution code:
s = list(input())

if s[0] != "A":
    print("WA")
    exit()
if s[2:-1].count("C") != 1:
    print("WA")
    exit()
for t in s:
    if t.isupper() and t != "A" and t != "C":
        print("WA")
        exit()

print("AC")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

S = s()

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

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

if c_count != 1:
    print('WA')
    sys.exit()

for i in range(len(S)):
    if i == 0 or i == c_index:
        continue
    if S[i].upper() == S[i]:
        print('WA')
        sys.exit()

print('AC')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
flag = True
if S[0] != "A":
    flag = False
s_n = S[2:-1]
c_c = 0
ci = 0
for i,si in enumerate(s_n):
    if si == "C":
        ci = i+2
        c_c += 1

if c_c != 1:
    flag = False

for i,si in enumerate(S):
    if i == 0 or i == ci:
        continue
    if not si.islower():
        flag = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

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

count=0
for ch in s:
    if not ('a' <= ch <= 'z'):
        count += 1
print('WA' if count-2!=0 else 'AC')

Submission status: Accepted

Solution code:

ans = "WA"
s = list(input())
if s[0] == "A":
  if s[2:-1].count("C") == 1:
    c = s[2:-1].index("C")+2

    if all([ s[i].islower() for i in range(1,len(s)) if i != c]):
      ans = "AC"

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

Submission status: Accepted

Solution code:
def abc():
    s = input().rstrip()
    if s[0] != 'A':
        print('WA')
        return
    if s[2:-1].count('C') != 1:
        print('WA')
        return
    trimed = s.replace('A', '').replace('C', '')
    if trimed != trimed.lower():
        print('WA')
        return

    print('AC')


abc()

Submission status: Accepted

Solution code:

S = input()

FA = False
FB = False
FC = True
BC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

if S[0] == "A":
    FA = True

cnum = 0

for i in range(len(S)):

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

    elif i != 0 and ( S[i] in BC ):

        FC = False


if cnum == 1:
    FB = True


if FA and FB and FC:
    print ("AC")

else:
    print ("WA")

Submission status: Accepted

Solution code:
n=list(input())
count=0
if n[0]=='A' and n[2:-1].count('C')==1:
    del n[0]
    n.remove('C')
    for i in range(len(n)):
        if n[i].islower()==1:
            count+=1
    if count==len(n):
        print('AC')
    else:
        print('WA')
    
else:
    print('WA')

Submission status: Accepted

Solution code:
S = input()
ss = list('abcdefghijklmnopqrstuvwxyz')

flag = True
cnt = 0
for i in range(len(S)):
    if i == 0:
        if S[i] != 'A':
            flag = False
        continue
    elif 2 <= i <= len(S) - 2:
        if S[i] == 'C':
            cnt += 1
            continue
    if S[i] not in ss:
        flag = False

if flag and cnt == 1:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = input()

WA = "WA"

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

if S[1].isupper():
    print(WA)
    exit()

C_cnt = 0
for i in range(2, len(S) - 1):
    if S[i] == 'C':
        if C_cnt == 0:
            C_cnt += 1
            continue
        else:
            print(WA)
            exit()
    else:
        if S[i].isupper():
            print(WA)
            exit()

if C_cnt == 0:
    print(WA)
    exit()

if S[len(S) - 1].isupper():
    print(WA)
    exit()

print("AC")

Submission status: Accepted

Solution code:
s = input()
lowercase = [chr(ord('a') + i) for i in range(26)]
#print(lowercase)

ans = 'AC'
c_count = 0
for i in range(len(s)):
  yet = True
  if i == 0:
    yet = False
    if s[i] != 'A':
      ans = 'WA'
      break
  if yet and 2 <= i <= len(s) - 2:
    if s[i] == 'C':
      yet = False
      c_count += 1
        
  if yet:
      if not s[i] in lowercase:
        ans = 'WA'
        break
if c_count != 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(x.isupper() for x in s) == 2:
  print('AC')
else:
  print('WA')

Submission status: Accepted

Solution code:
S = input()

alphabets = set(chr(ord('a')+x) for x in range(26))

bl1 = (S[0] == 'A')
bl2 = (S[2:-1].count('C') == 1)
bl3 = (set(S) - set('AC') <= alphabets)

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

Submission status: Accepted

Solution code:
n = input()

result = "AC"
if n[0] != "A":
        result = "WA"
        print(result)
        quit()

carea = n[2:-1]
ccount = 0
for i in carea:
        if i == "C":
                ccount += 1
if ccount >= 2 or ccount == 0:
        result = "WA"
        print(result)
        quit()

for i in carea:
        if i == "A":
                result = "WA"
                print(result)
                quit()

if n[-1] == "C" or n[-1] == "A":
        result = "WA"
        print(result)
        quit()

if n[1] == "C" or n[1] == "A":
        result = "WA"
        print(result)
        quit()


for i in n:
        if i.isupper() == True:
                if i not in "AC":
                        result = "WA"
                        print(result)
                        quit()
print(result)

Submission status: Accepted

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

ans = 'AC'

if S[0] != 'A':
    ans = 'WA'

cnt = 0
for i in range(1, n):
    if S[i] == 'C' and (i >= 2 and i <= n-2):
        cnt += 1
    elif S[i] >= 'a' and S[i] <= 'z':
        continue
    else:
        ans = 'WA'
if cnt != 1:
    ans = 'WA'

print(ans)

Submission status: Accepted

Solution code:
s = list(input())
if s[0] == "A" and s[2:-1].count("C") == 1:
    s.remove("A")
    s.remove("C")
    for i in range(len(s)):
        if s[i].islower():
            continue
        else:
            print("WA")
            exit()
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

S = sys.stdin.readline().rstrip()

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

if ok:
    orig = S
    cs = list(S.lower())
    cs[0] = 'A'
    cs[S.index('C')] = 'C'

    ok &= S == ''.join(cs)
    if ok:
        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 and s.replace('A', 'a').replace('C', 'c').islower():
  print("AC")
else:
  print("WA")

Submission status: Accepted

Solution code:
S = input()
flg = 0
if S[0] == 'A':
    flg += 1
if S[1].isupper():
    flg += 1000
for i in range(2, len(S)-1):
    if S[i] == 'C':
        flg += 10
    elif S[i].isupper():
        flg += 1000
if S[-1].isupper():
    flg += 1000
if flg == 11:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = input()

fa = (s[0] == 'A')

cntC = 0
fc = True
for i in range(2, len(s)-1):
    if s[i] == 'C':
        cntC += 1
    elif s[i].isupper():
        fc = False
if s[1].isupper() or s[-1].isupper():
    fc = False

fb = (cntC == 1)

if fa and fb and fc:
    print("AC")
else:
    print("WA")