Problem:


Score : 200 points

Problem Statement

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

The initial character of S is an uppercase A.

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

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

Constraints

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

Each character of S is uppercase or lowercase English letter.

Input

Input is given from Standard Input in the following format:

S

Output

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

Sample Input 1

AtCoder

Sample Output 1

AC

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

Sample Input 2

ACoder

Sample Output 2

WA

The second letter should not be C.

Sample Input 3

AcycliC

Sample Output 3

WA

The last letter should not be C, either.

Sample Input 4

AtCoCo

Sample Output 4

WA

There should not be two or more occurrences of C.

Sample Input 5

Atcoder

Sample Output 5

WA

The number of C should not be zero, either.



Sample input:
AtCoder


Sample output:
AC

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

S = [i for i in input()]
if S[0] != "A":
    print("WA")
    sys.exit()
else:
    S[0] = 'a'

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

for i in S:
    if "a" <= i <= "z":
        pass
    else:
        print("WA")
        sys.exit()

print("AC")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

if S[0] == 'A' and S[2:len(S)-1].count('C') == 1:
    for s in S[1:]:
        if s not in ('C') and s.isupper():
            print('WA')
            exit()
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s=input()
a="AC"
if s[0] != "A":
	a="WA"

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

if cnt!=1:
	a="WA"

for i in range(1, len(s)):
	if s[i]!="C" and ord(s[i]) < ord("a"):
		a="WA"

print(a)

Submission status: Accepted

Solution code:
S = input()

countA = 0
countC = 0
for i in range(len(S)):
    if i == 0:
        if S[i] != 'A':
            print('WA')
            quit()
        else:
            countA += 1
            continue
    if S[i] == 'C':
        if i < 2 or i == len(S)-1:
            print('WA')
            quit()
        countC += 1
    elif not S[i].islower():
        print('WA')
        quit()
    if countA > 1 or countC > 1:
        print('WA')
        quit()

if countA != 1 or countC != 1:
    print('WA')
    quit()
print('AC')

Submission status: Accepted

Solution code:
S = input()

if S[0] == 'A' and S[2:-1].count('C') == 1:
    if S.replace('A', '').replace('C', '').islower():
        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:
    c = S.index('C')
    if S[1:c].islower() and S[c+1:].islower():
        print('AC')
        exit()


print('WA')

Submission status: Accepted

Solution code:
S = input()
l = len(S)
A = list(S)
flg = 0
if 'C' in A:
    C = A.index('C')
else:
    print('WA')
    flg = 1

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

Submission status: Accepted

Solution code:
S = input()

if S[0] == 'A':
    f1 = True
else:
    f1 = False

C_cnt = 0
for s in S[2:-1]:
    if s == 'C':
        C_cnt += 1
if C_cnt == 1:
    f2 = True
else:
    f2 = False

f3 = True
for s in S:
    if s == 'A' or s == 'C':
        continue
    if s != s.lower():
        f3 = False
        break

if f1 and f2 and f3:
    print('AC')
else:
    print('WA')

Submission status: Accepted

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

S = [i for i in input()]
count = 0

if S.pop(0) == 'A':
    count += 1

if S[1:-1].count('C') == 1:
    count += 1
    S.remove('C')

    if ''.join(S).islower():
        count += 1

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

Submission status: Accepted

Solution code:
S = input()
if S[0] == "A" and S[2:-1].count("C") == 1 and S.count("A") == 1 and S.count("C") == 1:
  S=S.replace("A","a")
  S=S.replace("C","c")
  if S.islower():
    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):
  cnt = 0
  for i in S:
    if(not (97<=ord(i) and ord(i)<=122)):
      cnt+=1
  if(cnt==2):
    print('AC')
  else:
    print('WA')
else:
  print('WA')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import itertools
import collections
import functools
import math
from queue import Queue
INF = float("inf")


def solve(S: str):

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

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

    flag = False
    for i, c in enumerate(S):
        if i == 0:
            continue
        if ord("a") <= ord(c) and ord(c) <= ord("z"):
            continue
        elif 1 < i and i < len(S)-1 and c == "C" and flag == False:
            # print("ga")
            flag = True
            continue
        else:
            print("WA")
            return
    print("AC")

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from collections import Counter
from functools import reduce
import fractions
import math
import statistics
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]  # LIST INT
def LF(): return [float(x) for x in sys.stdin.readline().split()]  # LIST FLOAT
def LS(): return sys.stdin.readline().split()  # LIST STRING
def MI(): return map(int, sys.stdin.readline().split())  # MAP INT
def II(): return int(sys.stdin.readline())  # INPUT INT
def IS(): return input()  # INPUT STRING
def P(x): return print(x)
def C(x): return Counter(x)
def GCD_LIST(numbers):  # greatest common divisor
    return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers):  # least common multiple
    return reduce(LCM, numbers)
def LCM(m, n):
    return (m * n // fractions.gcd(m, n))


s = IS()
if s[0] == 'A' and s[2:len(s)-1].count('C') == 1 and ''.join([s[i] for i in range(1, len(s)) if not i == s.index('C')]).islower():
    print('AC')
else:
    print('WA')

Submission status: Accepted

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

if (S[0] == "A"):
    Flag += 1

if (S[2:-1].count("C") == 1):
    Flag += 1

if (Flag == 2):
    S.remove("A")
    S.remove("C")
    if (str(S).islower()):
        Flag += 1

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

Submission status: Accepted

Solution code:
import string
import sys
s = str(raw_input())
if (s[0] == 'A') & (s[2:-1].count('C') == 1):
	if (s.count('A') == 1) & (s.count('C') == 1):
		strans = s.translate(string.maketrans("AC", "ac"))
		slower = s.lower()
		if strans == slower:
			print 'AC'
			sys.exit()
print 'WA'

Submission status: Accepted

Solution code:
S = input()
if(S[0]=='A' and S[2:-1].count('C') == 1):
  cnt = 0
  for i in S:
    if(not (97<=ord(i) and ord(i)<=122)):
      cnt+=1
  if(cnt==2):
    print('AC')
  else:
    print('WA')
else:
  print('WA')

Submission status: Accepted

Solution code:
S = input()

ans = 0

for i in S:
  if str.islower(i):
    ans += 1

s = S[2:len(S)-1]

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

print("WA")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
if S[0] == 'A':
    if S[2 : len(S) - 1].count('C') == 1:
        S[S.index('C')] = 'a'
        S[0] = 'a'

        l = list(map(ord, S))
        i = 0
        while i < len(l):
            if l[i] >= 97 and l[i] <= 122:
                i += 1
            else:
                print('WA')
                break
        if i == len(l):
            print('AC')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = (input())
l = len(S)
for i,c in enumerate(S[2:],2):
    if c == "C":
        break
tmp = S[1:i]+S[i+1:]
if (i != l-1) and (S[0]=="A") and(tmp.lower()==tmp):
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
l=list(input())
if l[0]=="A":
  del l[0]
  c=0
  p=0
  for i in range(1,len(l)-1):
    if l[i]=="C":
      c+=1
      p=i
  if c==1:
    del l[p]
    if str.islower("".join(l)):
      print("AC")
    else:
      print("WA")
  elif c!=1 :
    print("WA")
else:
  print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def solve(S):
    if not S[0] == 'A':
        return False
    cnt = 0
    c = 0
    for i in range(2,len(S)-1):
        if S[i] == 'C':
            cnt = cnt+1
            c = i
    if not cnt == 1:
        return False
    for i in range(len(S)):
        if not (ord(S[i]) <= ord('z') and ord(S[i]) >= ord('a')):
            if(i == 0 or i == c):
                continue
            else:
                return False
    return True
            
S = input()
print("AC" if solve(S) else "WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
S=(stdin.readline().rstrip())
flag=0
if S[0] != "A":
    flag=1
if S[2:-1].count("C") != 1:
    flag=1
for j in S.replace("A","").replace("C",""):
    if j.islower() != True:
        flag=1
if flag == 1:
    print("WA")
else:
    print("AC")

Submission status: Accepted

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

Submission status: Accepted

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

s = list(input())

answer = True

if s[0] != "A":
    answer = False

c = 0


for i in range(2,len(s)-1):
    if s[i] == "C":
        c += 1

if c != 1:
    answer = False

capital = 0


for i in range(len(s)):
    if s[i].isupper():
        capital += 1

if capital != 2:
    answer = False

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

Submission status: Accepted

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


S = input()

ans = True

if S[0] != 'A':
    ans = False
if S[2:-1].count('C') != 1:
    ans = False
if len([i for i in S if i.islower()]) != len(S) - 2:
    ans = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding: utf-8
S = input()
flag1, flag2, flag3 = False, False, False
if S[0] == "A":
    flag1 = True
    if "C" in S[2:-1] and S[2:-1].count("C") == 1:
        flag2 = True
        cnt = 0
        AC_cnt = 0
        for i in range(len(S)):
            if S[i] == S[i].lower() and S[i] != "A" and S[i] != "C":
                cnt += 1
            elif S[i] == "A" or S[i] == "C":
                AC_cnt += 1
        if cnt + AC_cnt == len(S):
                flag3 = True
print("AC" if flag1 and flag2 and flag3 else "WA")

Submission status: Accepted

Solution code:
S = input()

ans = True
if S[0] != "A":
    ans = False
if S[2:-1].count("C") != 1:
    ans = False
if len([x for x in S if x.islower()]) != len(S) - 2:
    ans = False

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

Submission status: Accepted

Solution code:
s=input();print('WAAC'[s[0]=='A'and s.count('A')==1 and 'C' in s[2:-1] and s.count('C')==1 and s.replace('A','').replace('C','').islower()::2])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import deque
S=input()
can=True
kazu=0
for i in range(len(S)):
    s=S[i]
    if i==0:
        if s!="A":
            can=False
        continue
    if 2<=i<=len(S)-2:
        if s=="C":
            kazu+=1
            continue
    if s.isupper():
        can=False
if kazu!=1:
    can=False
if can:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s=input();ans="AC"
for i in range(len(s)):
  if s[i]<="Z" and "A"!=s[i]!="C":ans="WA"
if s[0]!="A":ans="WA"
s=s[1:]
if "C"in s[0]+s[-1]:ans="WA"
s=s[1:-1]
if not"C"in s:ans="WA"
n=s.find("C");s=s[:n]+s[n+1:]
if "C"in s:ans="WA"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = input()

ans = False

if S[0] == "A":
    if S[2:-1].count("C") == 1:
        S2 = S.replace("C", "c")
        if S2[1:].islower():
            ans = True

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

Submission status: Accepted

Solution code:
s = input()

ans = True
if s[0] is not "A":
  ans = False
if s[1] is "C" or s[-1] is "C":
  ans = False
if "C" not in s:
  ans = False
if s.count("C") > 1 or s.count("A") > 1:
  ans = False
for c in s:
  if c is not "A" and c is not "C" and c.isupper():
    ans = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
if s[0] == "A":
    if s[2:-1].count("C") == 1:
        s.remove("C")
        del s[0]
        a = str(s)
        if a.islower():
            print("AC")
            exit()
print("WA")

Submission status: Accepted

Solution code:
from sys import stdin
s = stdin.readline().rstrip()
if s[2:-1].count('C') == 1:
    ic = s[2:-1].index('C')+2
    if ic>len(s):
      ic=len(s)-1
    if s[0]=='A' and (s[1:ic]+s[ic+1:]).islower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

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

def main():
	S = input()
	S = list(S)
	
	if S[0] != "A":
		print("WA")
		sys.exit()
		
	tmp = S[2:-1]
	p = -1
	flg = False
	for i, val in enumerate(tmp):
		if val == "C":
			flg = True
			p = i + 2
	if flg == False:
		print("WA")
		sys.exit()
		
	for i, val in enumerate(S):
		if i == 0 or i == p:
			continue
		if val.islower() == False:
			print("WA")
			sys.exit()
	
	print("AC")
		
if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
large=list("BDEFGHIJKLMNOPQRSTUVWXYZ")
small=list("abcdefghijklmnopqrstuvwxyz")
s=list(input())
if s[0]!="A" or s.count("A")!=1:
  print("WA")
  exit()
t=s[2:len(s)-1]
if t.count("C")!=1:
  print("WA")
  exit()
for i in s:
  if i in large:
    print("WA")
    exit()
print("AC")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str=list(input())
flag=True
if str[0]!='A':
    flag=False
str[0]='a'
cnt=0
for i in range(2,len(str)-1):
    if str[i]=='C':
        cnt+=1
        if cnt==1:
            str[i]='c'
if cnt!=1:
    flag=False

tmp="".join(str)
if not tmp.islower():
    flag=False

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

Submission status: Accepted

Solution code:
import string

alp = string.ascii_uppercase

def main():
    S = input()
    len_s = len(S)

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

    for i in range(2, len_s-1):
        if S[i] == 'C':
            c_index = i
            break
        if i == len_s-2:
            print ('WA')
            return

    for i in range(1, len_s):
        if i == c_index:
            continue
        if S[i] in alp:
            print ('WA')
            return

    print ('AC')

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = raw_input()
if s[0] != 'A':
	print 'WA'
else:
	if s[-1] != 'A' and s[-1] != 'C' and not s[-1].islower():
		print 'WA'
	elif s[1] != 'A' and s[1] != 'C' and not s[1].islower():
		print 'WA'
	else:
		ss = s[2:-1]
		c = 0
		flag = True
		for sss in ss:
			if sss == 'C':
				c += 1
			else:
				if sss != 'A' and not sss.islower():
					flag = False
					break
		if c != 1:
			flag = False
		if flag:
			print 'AC'
		else:
			print 'WA'

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def a(s) :
	if s[0] != 'A':
		return 'WA'
	count = 0
	for w in s[2:-1]:
		if w =='C':
			count += 1
	if count != 1:
		return 'WA'
	for w in s:
		if w != 'A' and w != 'C' and w.isupper() :
			return'WA'
	return 'AC'
print a(raw_input())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
S_len = len(S)
S_mid = list(S[2:S_len-1])
S_head = S[0]
del S[2:S_len-1]
del S[0]
if S_head == "A":
    if S_mid.count("C") == 1:
        S = "".join(S)
        if S.islower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

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

for i, charS in enumerate(S):
    if charS == "C" and (1 < i and i < N-1):
        flag = True
        numC = i
        break

if S[0] != "A":
    flag = False

if flag:
    text = [S[j] for j in range(N) if j != 0 and j != numC]
    text = ''.join(text)
    if not(text.islower()):
        flag = False

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
S = sorted(s)
print("AC" if s[0]=="A" and s[2:-1].count("C")==1 and "Z"<S[2] else "WA")

Submission status: Accepted

Solution code:
S = input()

if S[0] == "A":
    if S[2:-1].count("C") == 1:
        Ssorted = sorted(S)
        if "Z" < Ssorted[2]:#大文字<小文字
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()

if s[0] == 'A':
    index = s.find('C', 2, -1)
    s = s[:index] + s[index + 1:]
    if index > 0:
        if s[1:].islower():
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print("WA")

Submission status: Accepted

Solution code:
S = input()

count = 0

if S[0] == 'A' and S[0].isupper():
    count = count + 1

num_loop = len(S) - 3
count_ = 2
c_num = 0
for i in range(num_loop):
    if S[count_] == 'C' and S[count_].isupper():
        c_num = c_num + 1
    count_ = count_ + 1
if c_num == 1:
    count = count + 1


if count == 2:
    up_count = 0
    for i in range(len(S)):
        if S[i].islower():
            continue
        else:
            up_count = up_count + 1

    if up_count == 2:
        count = count + 1

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

Submission status: Accepted

Solution code:
s = list(str(input()))
res = 'AC'
if(s[0] != 'A') : res = 'WA'
if(s[2:len(s)-1].count('C') != 1 ) : res = 'WA'
if('A' in s) : s.remove('A')
if('C' in s) : s.remove('C')
for i in range(len(s)) :
  if(s[i].isupper()) : res = 'WA'
print(res)

Submission status: Accepted

Solution code:
s=input()
if s[0]!='A':
    print('WA')
else:
    count=0
    for i in range(2,len(s)-1):
        if s[i]=='C':
            count+=1
    if count!=1:
        print('WA')
    else:
        a=list(s)
        a.remove('A')
        a.remove('C')
        b=''.join(a)
        if b.islower():
            print('AC')
        else:
            print('WA')

Submission status: Accepted

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

Submission status: Accepted

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

if S[0] == 'A' and T.count('C') == 1 and X.lower() == X:
    print("AC")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

def hasC(txt):
    c = 0
    for t in txt:
        if t == "C":
            if c > 0:
                return False
            c = 1
    return c == 1
def allLower(txt):
    a = ord("a")
    z = ord("z")
    for t in txt:
        tc = ord(t)
        if tc < a or tc > z:
            return False
    return True

if S[0] != "A":
    print("WA")
    exit()
if not hasC(S[2:-1]):
    print("WA")
    exit()
nonC = S[:2] + S[2:-1].replace("C", "") + S[-1]
if not allLower(nonC[1:]):
    print("WA")
    exit()
print("AC")

Submission status: Accepted

Solution code:
import re

r = input()
if r.startswith("A"):
  if len(re.findall("C",r[2:-1])) == 1:
    r = r[1:2]+r[2:-1].replace("C","")+r[-1]
    if r.islower():
      print("AC")
    else:
      print("WA")
  else:
    print("WA")
else:
  print("WA")

Submission status: Accepted

Solution code:
S = list(input())
AC = True
if S[0] != "A" or S.count("C") != 1 or not 2 <= S.index("C") <= len(S)-2:
    AC = False
else:
    count = 0
    for i in range(1, len(S)):
        if "A" < S[i] < "Z":
            count += 1
            if count == 2:
                AC = False

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

Submission status: Accepted

Solution code:
ans=0
count=0
s=input()
if s[0]=="A":
        ans+=1
cut=s[2:-1]
if cut.count("C")==1:
        ans+=1
cap=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
for i in range(len(s)):
        if s[i] in cap:
                count+=1
if count==2:
        ans+=1
if ans==3:
        print("AC")
else:
        print("WA")

Submission status: Accepted

Solution code:
S = str(input())
flag = False
count = 0
tmp_str = ""
if S.count("C") == 1 and S[0] == "A":
  flag = True
  for i in range(1,len(S),1):
    if S[i] == "C":
      count = i
    else:
      tmp_str += S[i]

if (flag == True) and (count > 1) and (count < len(S)-1) and (tmp_str.islower() == True):
  print("AC")
else:
  print("WA")

Submission status: Accepted

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

if S[0] == 'A':
    count_C = 0
    for ind in range(3-1, len(S)-1):
        if S[ind] == 'C':
            ind_C = ind
            count_C += 1
    if count_C == 1:
        del S[0]
        del S[ind_C - 1]
        s = 'a'
        for i in S:
            s = s + i
        if s.islower():
            print('AC')
            exit()
print('WA')

Submission status: Accepted

Solution code:
s = input()

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

if s[1].isupper() or s[-1].isupper():
    print("WA")
    exit()

count = 0
for s_ in s[2:]:
    if s_.isupper():
        if s_ == "C":
            count += 1
        else:
            print("WA")
            exit()
        

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

Submission status: Accepted

Solution code:
S = list(input())
judge = 1 #1:OK , 0:NG
C_count = 0
C_index = 0

if(S[0] != 'A'):#先頭の文字判定
  print('WA')
  
else: #S{i] == 'A'
 for i in range(len(S)):
  if(i != 0):
   if(S[i] == 'C'):
     C_count += 1
     C_index = i
   else:
     if(S[i] != S[i].lower()):#小文字判定
       judge = 0
      
 if(C_count != 1):#'C':1個 , 'C'のインデックスの判定
   judge = 0
 else:
  if( (C_index < 2)or((len(S)-2) < C_index) ):
    judge = 0
 
 if(judge == 1):
    print('AC')
 else:
    print('WA')

Submission status: Accepted

Solution code:
#ABC104 B
#Sが次をみたすかどうか判定せよ
#先頭の文字が'A'
#2文字目は小文字
#末尾の文字は小文字
#3文字目から末尾から2文字目までには'C'がちょうど1回だけ登場し,残りは全部小文字
#
import re
r = re.compile(r'^A[a-z]+C[a-z]+$')
msg = ['WA','AC']
print(msg[len(r.findall(str(input())))])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

def isLowerWithoutAC(s):
    l = list(s)
    l.remove('A')
    l.remove('C')
    return ''.join(l).islower()

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

Submission status: Accepted

Solution code:
s=input()
character=["q","w","e","r","t","y","u","i","o","p","l","k","j","h","g","f","d","s","a","z","x","c","v","b","n","m"]
flag=0
for i in range(len(s)):
    if i==0:
        if s[i]!="A":
            print("WA")
            exit()
    elif 2<=i<=len(s)-2:
        if flag==1 and s[i]=="C":
            print("WA")
            exit()
        elif flag==0 and s[i]=="C":
            flag=1
        elif flag==0 and not s[i] in character:
            print("WA")
            exit()
        elif flag==1 and not s[i] in character:
            print("WA")
            exit()
    else:
        if not s[i] in character:
            print("WA")
            exit()
if flag==0:
    print("WA")
    exit()
print("AC")

Submission status: Accepted

Solution code:
# coding: utf-8
S = input()
ans = 'WA'
if S[0] == 'A':
  if 'C' in S[2:-1]:
    c = 0
    for s in S:
      if ord(s) < 97:
        c += 1
    if c == 2:
      ans = 'AC'
print(ans)

Submission status: Accepted

Solution code:
def accepted(S: str)->bool:
    if S[0] != 'A':
        return False
    if sum(1 for c in S[2:-1] if c == 'C') != 1:
        return False

    sorted_s = ''.join(sorted(S)[2:])
    return sorted_s == sorted_s.lower()


if __name__ == "__main__":
    S = input()
    ac = accepted(S)
    print('AC' if ac else 'WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
t = s.replace('A','c').replace('C','c')
if s[0]!='A' or 'C' not in s[2:len(s)-1] or s[2:len(s)-1].count('C') != 1 or t != t.lower():
    print('WA')
else:
    print('AC')

Submission status: Accepted

Solution code:
def solve(string):
    is_a = string[0] == "A"
    index_c = string.find("C")
    rest = string[1:index_c] + string[index_c + 1:]
    return "AC" if is_a and 1 < index_c < len(string) -1 and rest == rest.lower() else "WA"


if __name__ == '__main__':
    print(solve(input()))

Submission status: Accepted

Solution code:
S=input()

def solve():
  temp=0
  if S[0]!='A':
    print('WA')
    return
  if not 'a'<=S[1]<='z':
    print('WA')
    return
  for i in range(2,len(S)-1):
    if S[i]=='C':
      temp+=1
      if temp>1:
        print('WA')
        return
  if temp==0:
    print('WA')
    return
    
  if not 'a'<=S[len(S)-1]<='z':
    print('WA')
    return
  
  print('AC')

solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
if S[0] != 'A':
  print("WA")
else:
  if 'C' not in S[2:-1] or S[2:-1].count('C') > 1:
    print("WA")
  else:
    i = S.find('C')
    S = S[0:1].lower() + S[1:i] + S[i:i+1].lower() + S[i+1:]
    if S.islower():
      print("AC")
    else:
      print("WA")