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:
import sys
S=input()
first=S[0]
second=S[1]
last=S[len(S)-1]
cnt=0
moji=[i for i in "abcdefghijklmnopqrstuvwxyz"]
# print(len(moji))

if first=="A":
  for i in range(2,len(S)-1):
  
    if S[i]=="C":
      cnt+=1
    else:
      if (S[i] in moji)==False:
        print("WA")
        sys.exit()

  if cnt==1 and ((last in moji)==True) and ((second in moji)==True):
    print("AC")
  else:
    print("WA")
        
else:
  print("WA")

Submission status: Accepted

Solution code:
s = input()
if s[0]!='A' or s[2:-1].count('C')!=1:
    print('WA')    
else:
    cnt = 0
    for i in s:
        if i<'a' or 'z'<i:
            cnt += 1
    if cnt==2:
        print('AC')
    else:
        print('WA')

Submission status: Accepted

Solution code:
import copy
s=list(input())
if s[0]=='A' and 'C' in s[2:len(s)] :
  t=copy.copy(s)
  s.remove('A')
  s.remove('C')
  result=''.join(s)
  if len(s)==len(t)-2 and result.islower()==True and t[-1]!='C':
    print('AC')
  else:
    print('WA')
    
else:
  print('WA')

Submission status: Accepted

Solution code:
s = input()
ans = 'AC'
if s[0] != 'A':
    ans = 'WA'
elif s[2:-1].count('C') != 1:
    ans = 'WA'
elif s[1:].replace('C','').lower() != s[1:].replace('C',''):
    ans = 'WA'
print(ans)

Submission status: Accepted

Solution code:
# AtCoder
S = input()

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

if not S.count('C', 2, -1) == 1:
    print('WA')
    exit()

for i in S:
    if i == 'A' or i == 'C':
        pass
    else:
        if not i.islower():
            print('WA')
            exit()


print('AC')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
ans = 1
sw = 0
for i in range(len(s)):
    if i == 0 :
        if s[0] !="A":
            ans = 0
    elif 2 <= i <= len(s)-2 and s[i] == "C":
        sw += 1
    else:
        if not(97<= ord(s[i]) <= 122):
            ans = 0
if ans == 1 and sw == 1:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
moji=str(input())
lst=["A", "B", "D", "E", "F", "G", "H", "I", "J", "K"< "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
cnt = 0
temp = 0
for i in range(len(moji)):
  if i==0:
    if moji[i]=="A":
      continue;
    else:
      cnt+=1
      break;
  if 2<=i<=len(moji)-2:
    if moji[i] in lst:
      cnt +=1
      break;
    elif moji[i] == "C":
      temp += 1
      lst.append("C")
      continue;
  if i==1 or i==len(moji)-1:
    if moji[i] in lst or moji[i] == "C":
      cnt+=1
if cnt==0 and temp == 1:
  print("AC")
else:
  print("WA")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

alphala=[chr(i) for i in range(65, 65+26)]

#print(alphala)
s=input().rstrip()
count=0

if s[0]=="A":
    count+=1
x=0
for i in range(2,len(s)-1):
    u=s[i]
    if u=="C":
        x+=1
if x==1:
    count+=1
#print(count)
y=0
for i in range(len(s)):
    k=s[i]
    if k in alphala:
        y+=1
    #print(y)
if y==2:
    count+=1
#print(count)
if count==3:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
S = input()
chk1 = 0
chk2 = 0
chk3 = 0
chk4 = 0
if S[0] == 'A':
    for i in range(1, len(S), 1):
        ord_c = ord(S[i])
        ###先頭2文字目が大文字なら
        if i == 1 and (65 <= ord(S[i]) and ord(S[i]) <= 90):
            chk1 = 1

        ###末尾が大文字なら
        if i == len(S)-1 and (65 <= ord(S[i]) and ord(S[i]) <= 90):
            chk2 = 1
        ###Cだったら
        elif ord_c == 67:
            chk3 += 1

        ###C以外の大文字があったら
        elif 65 <= ord_c and ord_c <= 90:
            chk4 = 1

    if chk3 == 1 and chk1 == 0 and chk2 == 0 and chk4 == 0:
        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[1:s.index('C')] + s[s.index('C') + 1:]).islower():
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
# ABC104B

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

Submission status: Accepted

Solution code:
S="abcdefghijklmnopqrstuvwxyz"
s=input()
n=len(s)
flag=0
if s[0]!="A":
    flag=1
cut=s[2:n-1]
if cut.count("C")!=1:
    flag=1
else:
    cut=s[1:]
    for c in cut:
        if ((not c in S) and c!="C"):
            flag=1
            break

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

Submission status: Accepted

Solution code:
s=input()
lenlen=len(s)
count=0
if s[0]=="A":
  t=s[2:lenlen-1]
  for i in range(0,len(t)):
    if t[i]=="C":
      count+=1
  if count==1:
    tttt=0
    for j in range(0,lenlen):
      if not 97<=ord(s[j])<=122:
        tttt+=1
    if tttt==2:
      print("AC")
    else:
      print("WA")
  else:
    print("WA")
else:
  print("WA")

Submission status: Accepted

Solution code:
S = input()

jdg = True
cnt = 0

for i, s in enumerate(S):
    if i == 0 and s != 'A':
        jdg = False
        break
    if (i == 1 or i == len(S) - 1) and not s in 'abcdefghijklmnopqrstuvwxyz':
        jdg = False
        break
    if 2 <= i <= len(S) - 2 and s == 'C':
        cnt += 1
    if i >= 1 and not s in 'abcdefghijklmnopqrstuvwxyzC':
        jdg = False
        break
if cnt != 1: jdg = False
            
print('AC' if jdg else 'WA')

Submission status: Accepted

Solution code:
s = input()
ans = 'AC'
ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(s)):
    if i == 0:
        if s[i] != 'A':
            ans = 'WA'
    if i == 1 or i == len(s)-1:
        if s[i] not in ascii_lowercase:
            ans = 'WA'
if s[2:-1].count('C') != 1:
    ans = 'WA'
print(ans)

Submission status: Accepted

Solution code:
s = input()
if s[0]!='A' or s[2:-1].count('C')!= 1:
  print('WA')
  exit()
  
for c in s[1:]:
  if not(('a'<= c <= 'z') or  c=='C'):
    print('WA')
    break
else:
  print('AC')

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc104/tasks/abc104_b
s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1:
    t = s.replace('A', '')
    t = t.replace('C', '')
    for i in t:
        if ord('a') <= ord(i) <= ord('z'):
            continue
        else:
            print('WA')
            break
    else:
        print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline
MOD = 1000000007

S = input()[:-1]

S = list(S)

if S[0] == 'A':
    if 'C' in S[2:-1] and  S.count('C') == 1:
        cnt = 0
        for i in range(1,len(S)):
            if S[i].isupper() :
                if  S[i] == 'C':
                    continue
            else:
                cnt+=1
        #print(x)
        if cnt == len(S)-2:
            print("AC")
            exit()

print("WA")

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline
MOD = 1000000007

S = input()[:-1]

S = list(S)

if S[0] == 'A':
    if 'C' in S[2:-1] and  S.count('C') == 1:
        x = []
        for i in range(1,len(S)):
            if S[i] == 'C':
                continue
            x.append(S[i])
        
        #print(x)
        if str(x).islower():
            print("AC")
            exit()

print("WA")

Submission status: Accepted

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

s=list(input())
n=len(s)

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

if s[0]=='A' and cnt==1:
    s.pop(0)
    s.remove('C')
    for c in s:
        if c.islower()==False:
            print("WA")
            break
    else:
        print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = list(input())

ll = len(s)

ans = 'AC'

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

cnt = 0

for i in range(1, len(s)):
    if s[i].isupper():
        if i == 1 or i == ll - 1 or s[i] != 'C':
            ans = 'WA'
        cnt += 1

if cnt != 1:
    ans = 'WA'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

    for s in S[2:-1]:
        if s != 'C' and s.isupper():
            print('WA')
            return

    if S[1].isupper() or S[-1].isupper():
        print('WA')
        return

    print('AC')

sol()

Submission status: Accepted

Solution code:
s = input()
if s[0] != "A":
    ans = "WA"
elif ord(s[1]) < 91:
    ans = "WA"
elif ord(s[-1]) < 91:
    ans = "WA"
else:
    ans = "AC"
    c = 0
    for i in range(2, len(s) - 1):
        if s[i] == "C":
            c += 1
        elif ord(s[i]) < 91:
            ans = "WA"
            break
    if c != 1:
        ans = "WA"

print(ans)

Submission status: Accepted

Solution code:
S=input()
if S[0]!="A":
    print("WA")
    exit()
else:
    if S[2:-1].count("C")!=1:
        print("WA")
        exit()
    else:
        x=S.index("C")
        for i in range(len(S)):
            if i==0 or i==x:
                pass
            else:
                if 65<=ord(S[i])<=90:
                    print("WA")
                    exit()
print("AC")

Submission status: Accepted

Solution code:
S = input()
count_lower = sum(1 for s1 in S[1:] if s1.islower())
if S[0]=="A" and S[2:-1].count("C")==1 and count_lower==len(S)-2:
  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 s[1].islower() and s[1:].replace('C','',1).islower() else 'WA')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

    s = s[1:]
    s = s.replace('C','')

    if not s.islower():
        print('WA')
        exit()  

    print('AC')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()
ok = True

ok &= s[0] == 'A'
ok &= s[2:-1].count('C') == 1
ok &= s[1:].replace('C', '').islower()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
ok = True

ok &= s[0] == 'A'
ok &= s[1].islower()
ok &= s[2:-1].count('C') == 1
ok &= all(c.islower() for c in s[2:-1] if c != 'C')
ok &= s[-1].islower()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import sys

s = input()

ans = "AC"
cnt = 0

if s[0] != "A":
    ans = "WA"

for i in range(1, len(s)):
    t = s[i]
    if t == "C":
        if 2 <= i < len(s) - 1:
            cnt += 1
    else:
        if t.isupper():
            ans = "WA"

if cnt != 1:
    ans = "WA"

print(ans)

Submission status: Accepted

Solution code:
s = input()
small = [chr(i+97) for i in range(26)]
count = 0
for i in range(len(s)):
    if i == 0:
        if s[i] == 'A':
            continue
        else:
            print("WA")
            break
    elif i == 1:
        if not s[i] in small: 
            print("WA")
            break
    elif i == len(s)-1:
        if not s[i] in small:
            print("WA")
            break
    else:
        if s[i] == 'C':
            count += 1
        elif not s[i] in small:
            print("WA")
            break
else:
    if count == 1:
        print("AC")
    else:
        print("WA")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()
ans = True
count = 0
for i in range(len(S)):
    if i == 0 and S[0]!='A':
        ans = False
        break
    if 2 <= i <= len(S)-2:
        if S[i] == 'C':
            count += 1
            if count > 1:
                ans = False
                break
        elif ord(S[i])-ord('a') < 0 or ord(S[i])-ord('a') > 25:
            ans = False
            break
    if (i == 1 or i == len(S)-1) and ord(S[i])-ord('a') < 0 or ord(S[i])-ord('a') > 25:
        ans = False
        break
if ans and count==1:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = list(input())
ans = 'AC'

if S[0] != 'A':
    ans = 'WA'
if S[2:len(S) - 1].count('C') != 1:
    ans = 'WA'

tmp = 0
for s in S:
    if ord('a') <= ord(s) <= ord('z'):
        tmp += 1


if tmp != (len(S) - 2):
    ans = 'WA'

print(ans)

Submission status: Accepted

Solution code:
s = input()
ans = True
if s[0]!='A':
    ans = False
if s[2:-1].count('C')!=1:
    ans = False
upper = 0
for i in  s:
    if i.isupper():
        upper += 1

if upper != 2:
    ans = False

if ans:
    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\
   and s.replace('A', '').replace('C', '').islower():
  ans = 'AC'
print(ans)

Submission status: Accepted

Solution code:
S=list(input())

ans = 'AC'

#条件１
if S[0] != 'A':
    ans = 'WA'

#条件2
C_cnt=0
for s in S[2:-1]:
    if s=='C':
        C_cnt+=1
    
if C_cnt != 1:
    ans = 'WA'
    
#条件3
Up_cnt=0
for s in S:
    if s.isupper()==True:
        Up_cnt+=1
if Up_cnt != 2:
    ans = 'WA'
    
print(ans)

Submission status: Accepted

Solution code:
def judge(string):
    s_li = [x for x in string]
    if "A" in s_li:
        s_li.remove("A")

    if "C" in s_li:
        s_li.remove("C")

    return string[0] == "A" and string[2:-1].count("C") == 1 and str(s_li).islower()


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

Submission status: Accepted

Solution code:
import sys
s= input()
n =len(s)
Al = [chr(_)  for _ in range(97,124)]
if s[0] == "A" and s[2:n-1:1].count("C")==1:
    for i in range(1,n):
        if not(s[i] in Al or s[i]=="C"):
            print('WA')
            sys.exit()
    print('AC')
    sys.exit()
else:
    print('WA')

Submission status: Accepted

Solution code:
s = input()
out = False
if s[0] != 'A':
    out = True
C = False

if s[1].isupper():
    out = True

for ss in s[2:-1]:
    if ss == 'C':
        if C:
            out = True
        C = True
    elif s.isupper():
        out = True

if not C or s[-1].isupper():
    out = True

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

Submission status: Accepted

Solution code:
s = input()

ac = s[0] == 'A'
ac &= s[2:-1].count('C') == 1
ac &= s.replace('A', '').replace('C', '').islower()

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

Submission status: Accepted

Solution code:
s=input()
a=True
if s[0]!='A':
#Sの先頭の文字は大文字の A である。
    a=False

s2=s[2:-1]
if s2.count('C')!=1:
#Sの先頭から3文字目と末尾から2文字目の間（両端含む）に
# 大文字の C がちょうど1個含まれる
    a=False

s3=s.replace('C','c',1)
s3=s3.replace('A','a',1)
if s3.islower()==False:
#以上の A, C を除くSのすべての文字は小文字
    a=False

if a==True:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = input()

flag = True

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

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

Submission status: Accepted

Solution code:
s = input()

if s[0] == "A":
    if s[2: -1].count("C") == 1:
        if s.count("C") == 1:
            s = s.replace("C", "c")
            if s[1:].islower() == True:
                print("AC")
                exit()
print("WA")

Submission status: Accepted

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

if s[0] == "A":
    if s[2:l - 1].count("C") == 1:
        if s.count("A") == 1:
            if s.count("C") == 1:
                s = s.replace("A", "a")
                s = s.replace("C", "c")
                if s.islower() == True:
                    print("AC")
                    exit()
print("WA")

Submission status: Accepted

Solution code:
s = input()
x = s[0]
ans = 0
if x == "A":
    y = s[2:len(s)-1]
    z = y.count("C")
    if z == 1:
        a = y.replace("C","")
        word = s[1] + a + s[len(s)-1]
        if word.islower():
            ans += 1
if ans == 1:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()
count = 0
flag = True
for i in range(len(s)):
    if i==0:
        if s[0]!="A":
            flag = False
    else:
        if 2<=i<=len(s)-2:
            if s[i]=='C':
                if count>0:
                    flag = False
                else:
                    count += 1
            else:
                if 97>ord(s[i]) or ord(s[i])>122:
                    flag = False
        else:
            if 97>ord(s[i]) or ord(s[i])>122:
                flag = False
if count==0:
    flag = False
print('AC' if flag==True else 'WA')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import Counter
readline = sys.stdin.buffer.readline
MOD = 10**9+7
INF = float('inf')

def main():
    S = list(readline().rstrip().decode('utf-8'))

    bl = S[0] == 'A'
    bl &= ('C' in S[2:-1])

    if bl:
        S.remove('A');
        S.remove('C')

    bl &= all('a' <= x <= 'z' for x in S)

    answer = 'AC' if bl else 'WA'
    print(answer)




if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = list(input())
count_c = num[2:-1].count("C")

if num[0] != "A":
  print("WA")
else:
  if count_c > 1:
    print("WA")
  else:
    if count_c == 1:
      num.remove("C")
      num.remove("A")
      jadge = "".join(num)
      if jadge:
        suuzi = "false"
        for i in range(len(num)):
          if num[i].isdecimal():
            suuzi = "true"
            break
          elif num[i].isupper():
            suuzi = "true"
            break
        if(suuzi == "false"):
          print("AC")
        else:
          print("WA")
      else:
        print("WA")
    else:
      print("WA")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
for i in range(1, n):
    if ord(s[i]) < 97 and s[i] != "C":
        print("WA")
        exit()
cnt_c = 0
for i in range(2, n - 1):
    if s[i] == "C":
        cnt_c += 1
if cnt_c != 1:
    print("WA")
    exit()
print("AC" if s[0] == "A" else "WA")

Submission status: Accepted

Solution code:
s = input()
if s[0] != 'A': print('WA')
else:
    c_cnt = 0
    end_p = len(s)-2
    for i in range(1,len(s)):
        
        # C判定
        if 2 <= i <= end_p and s[i] == 'C':
            c_cnt += 1
        
        # 小文字かどうか
        elif s[i] != s[i].lower():
            print('WA')
            exit()

    if c_cnt != 1:
        print('WA')
    else:
        print('AC')

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    s = input().rstrip()
    alphabet = 'abcdefghijklmnopqrstuvwxyz' #26
    if s[0] == 'A':
        cnt = 0
        for i in range(len(s)):
            if 2<=i<=len(s)-2:
                if s[i] == 'C':
                    cnt += 1
                    k = i
        if cnt == 1:
            for i in range(len(s)):
                if i==0 or i==k:
                    continue
                else:
                    if s[i] not in alphabet:
                        break
            else:
                print('AC')
                exit()
    print('WA')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()
cnt = 0
if s[0] == "A" and s[2:-1].count("C") == 1:
    for i in range(len(s)):
        if ord(s[i])<=90:
            cnt += 1
    if cnt != 2:
        print("WA")
    else:
        print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()
cnt = 0
if s[0] == "A" and s[2:-1].count("C") == 1:
    for i in range(len(s)):
        if ord(s[i])<=90:
            cnt += 1
    if cnt != 2:
        print("WA")
        quit()
    else:
        print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
def main():
    S = input()
    L, R = 2, len(S) - 2
    if S[0] != 'A':
        print('WA')
        exit()

    cnt = 0
    for i in range(1, len(S)):
        if S[i] == 'C' and L <= i <= R:
            cnt += 1
            continue
        if S[i].isupper():
            print('WA')
            exit()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

if cnt!=2:
    print('WA')
else:
    print('AC')

Submission status: Accepted

Solution code:
S = input()

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

S=S.replace('A','a')
S=S.replace('C','c')  

if not S.islower():
  flag=0
     
print('AC' if flag==1 else 'WA')

Submission status: Accepted

Solution code:
S = list(input())
L = S[2:len(S)-1]
a = 0
for i in range(len(S)):
    if 65 < (ord(S[i])) <= 90:
        a = a+1

if L.count("C") == 1 and S[0] == "A" and a == 1:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
S=str(input())
letter="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
condition1 = S[0]=='A'
condition2 = len([1 for x in S[2:len(S)-1] if x=="C"]) == 1
count=0
for i in range(len(S)):
  if len([1 for x in letter if x==S[i]]) == 1:
    count = count + 1
condition3 = count == 2
if condition1 & condition2 & condition3:
  print('AC')
else:
  print('WA')

Submission status: Accepted

Solution code:
# from math import factorial,sqrt,ceil,gcd
# from itertools import permutations as permus
from collections import deque,Counter
# import re
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import networkx as nx
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb

# slist = "abcdefghijklmnopqrstuvwxyz"
S = input()

def check(S):
    if S[0]!="A":
        return False
    if Counter(S[2:-1])["C"]!=1:
        return False
    s_counter = Counter(S)
    for w in s_counter:
        if w.isupper():
            if w == "A":
                if s_counter[w] != 1:
                    return False
            elif w == "C":
                if s_counter[w] != 1:
                    return False
            else:
                return False
    return True

if check(S):
    print("AC")
else:
    print("WA")
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))

Submission status: Accepted

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

ans='AC'
c=0
cp=0
if s[0]!='A':
  ans='WA'
for i in range(2, l-1):
  if s[i]=='C':
    c+=1
    cp=i
if c!=1:
  ans='WA'
ls = s[1:cp] + s[cp+1:l]

if not ls.islower():
  ans='WA'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
b = "abcdefghijklmnopqrstuvwxyz"

if s[0] != "A":
	print ("WA")
	exit()
if s[1] not in list(b) or s[-1] not in list(b):
	print ("WA")
	exit()
flg = 0
for i in range(2,len(s)-1):
	if s[i] == "C":
		if flg == 1:
			print ("WA")
			exit()
		flg = 1
	else:
		if s[i] not in list(b):
			print ("WA")
			exit()
if flg == 0:
	print ("WA")
else:
	print ("AC")

Submission status: Accepted

Solution code:
S = input()

cap = S[0]
mid = list(S[2:-1])

if (mid.count('C') >= 1):
    index = S.index('C')
    strr = S[1:index] + S[index + 1 :]
else:
    print('WA')
    exit()


if (cap == 'A' and mid.count('C') == 1 and strr.islower() == True):
    print('AC')
else:
    print('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()

for i in S[1:].split('C'):
    if not i.islower():
        print('WA')
        exit()

print('AC')

Submission status: Accepted

Solution code:
S = input()

ans = 'AC'

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

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

X = S[1:].split('C')
for x in X:
    if x.islower():
        pass
    else:
        print('WA')
        exit()

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()

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

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

new_string=s.replace("A", "")
new_string=new_string.replace("C", "")

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

Submission status: Accepted

Solution code:
import sys
S = input()

if S[0] != "A":
    print("WA")
    sys.exit()
if S[1].isupper() or S[-1].isupper():
    print("WA")
    sys.exit()
T = S[2:len(S)-1]
if list(T).count("C") == 0 or list(T).count("C") > 1:
    print("WA")
    sys.exit()
for i in range(len(T)):
    if T[i].isupper() and T[i] != "C":
        print("WA")
        sys.exit()
print("AC")

Submission status: Accepted

Solution code:
s = list(input())
alpha = [chr(i) for i in range(97, 97+26)]

flag = True
if s[0] != "A" or (not "C" in s[2:-1]):
  flag = False
  
else:
  cin = s.index("C")
  for i in range(len(s)):
    if i == 0 or i == cin:
      continue

    if (not s[i] in alpha):
      flag = False
      break
    
print("AC" if flag else "WA")

Submission status: Accepted

Solution code:
S = list(input())
if S[0]=="A":
    s = S[2:-1]
    C_count = s.count("C")
    if C_count==1:
        C_index = s.index("C")
        del S[0] 
        del S[C_index+1]
        if "".join(S).islower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")