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 sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    if y > x // 2:
        y = x - y

    ret = 1

    for i in range(0, y):
        j = x - i
        i = i + 1

        ret = ret * j
        ret = ret // i

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


###############################################################################


def main():
    s = input()

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

    count = 0
    for c in s[2:-1]:
        if c == 'C':
            count += 1
    if count != 1:
        print('WA')
        return

    if s[1].isupper():
        print('WA')
        return

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

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

    print('AC')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s=input()
al=[chr(ord('a')+i) for i in range(26)]
f=False
if s[0]=='A':
    s_ = s[2:-1]
    Ccount=0
    for a in s_:
        if a in al:
            continue
        elif a=='C':
            if Ccount==1:
                Ccount+=1
                break
            else:
                Ccount+=1
        else:
            break
    if Ccount==1:
        f=True
    if s[-1] not in al:
        f=False
    if s[1] not in al:
        f=False
print('AC' if f else '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("A", "", 1)
      S = S.replace("C", "")
      if S.islower():
        print("AC")
      else:
        print("WA")
    else:
      print("WA")
  else:
    print("WA")
else:
  print("WA")

Submission status: Accepted

Solution code:
def count_apper(str) :
    n = 0
    for c in str :
        if c.isupper() :
            n = n+1
    return n

str = input()
if (str[0] == "A") and (str.count("C") == 1) and (1 < str.find("C") < len(str)-1) and (count_apper(str) == 2) :
                print("AC")
                exit()
print("WA")

Submission status: Accepted

Solution code:
s = input()
judg = [False]*3
if s[0] == "A":
  judg[0] = True
  if s[2:-1].count("C") == 1:
    judg[1] = True
    if (s[1] + s[-1]) == (s[1] + s[-1]).lower():
      judg[2] = True
print("AC" if all(judg) else "WA")

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s=list(str(input()))
n=len(s)
t=True
c=0
for i in range(n):
    if i == 0:
        if s[i]=="A":
            t=t and True
        else:
            t=False
    elif i == 1:
        if s[i]>="a" and s[i]<="z":
            t=t and True
        else:
            t = False
    else:
        if i!=n-1 and s[i] == "C":
            c+=1
        elif s[i]>="a" and s[i]<="z":
            t=t and True
        else:
            t = False
if c==1:
    t=t and True
else:
    t=False
if t:
    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[1].islower() and s[-1].islower() and (s[2:-1] == 'C' or s[2:-1].replace('C','').islower()):
    print('AC')
else:
    print('WA')

Submission status: Accepted

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

if s[0]!='A':
    print('WA')
else:
    if s.count('C')!=1:
        print('WA')
    else:
        if s.index('C')<2 or s.index('C')>len(s)-2:
            print('WA')
        else:
            s.remove('A')
            s.remove('C')
            
            count=0
            for i in range(len(s)):
                if str.islower(s[i]):
                    count+=1
            if count==len(s):
                print('AC')
            else:
                print('WA')

Submission status: Accepted

Solution code:
def main():
    s = list(input())
    count = 0

    if s[0] == 'A':
        for i in range(2, len(s)-1):
            if s[i] == 'C':
                count += 1
        if (count != 1):
            return 'WA'
        count = 0
        for i in range(len(s)):
            if s[i].isupper():
                count += 1
        if count > 2:
            return 'WA'
    else:
        return 'WA'

    return 'AC'
    


if __name__=='__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

if S[0] != "A" or S[2:-1].count("C") != 1:
    print("WA")
    exit()
else:
    S = S.replace("C","c", 1)

if S[1:].islower() == True:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
import sys

S = input()

if S[0] != 'A':
    print('WA')
    sys.exit()
if S[2:-1].count('C') != 1:
    print('WA')
    sys.exit()
position_C = S.find('C',2,-1)
AC_removed_S = S[1:position_C] + S[position_C+1:]

print('AC' if AC_removed_S.islower() else 'WA')

Submission status: Accepted

Solution code:
import re

S = input()

if S[0] == 'A' \
        and S[2:-1].count('C') == 1 \
        and re.match('^A[a-z]+C[a-z]+$', S):
    print('AC')
else:
    print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=list(input())
flag1=0
if S[0]!="A":
  flag1=1

S.pop(0)
flag2=0
for i in range(1,len(S)-1):
  if S[i]=="C":
    flag2=1
    S.pop(i)
    break
if flag2==0:
  flag1=1

for i in range(len(S)):
  if S[i] in list("ABCDEFGHIJKLMNOPQRSTUVWXYZ"):
    flag1=1

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

Submission status: Accepted

Solution code:
S = input()

ans = "WA"
if S[0] == "A":
    ans = "AC"
    S = S.replace("A", "a", 1)

count = 0
for i in range(2, len(S) - 1):
    if S[i] == "C":
        count += 1
        S = S.replace("C", "c", 1)
if count != 1:
    ans = "WA"

if not S.islower():
    ans = "WA"

print(ans)

Submission status: Accepted

Solution code:
S = input()

flag = False
if S[0] == "A":
    flag = True
    S = S.replace("A", "a", 1)

count = 0
for i in range(2, len(S) - 1):
    if S[i] == "C":
        count += 1
        S = S.replace("C", "c", 1)
if count != 1:
    flag = False

if not S.islower():
    flag = False

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

Submission status: Accepted

Solution code:
S = list(input())
ans = 'WA'
if S[0] == 'A' and S[2:len(S)-1].count('C') == 1 and S.count('A') ==1 and S.count('C') == 1:
    komozi =''
    for i in S:
        if i == 'A' or 'C':
            i = i.replace('A','')
            i = i.replace('C','')
        komozi += i
    if komozi.islower():
        ans = 'AC'
print(ans)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 'AC'
count = 0

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

s = 'a' + s[1:]

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

if count != 1:
    ans = 'WA'

if not s.islower():
    ans = 'WA'

print(ans)

Submission status: Accepted

Solution code:
sml='Cqwertyuiopasdfghjklzxcvbnm'

s=input()
n=len(s)
if s[0]=='A' and s[2:n-1].count('C')==1 and set(s[1:])<=set(sml):
  print('AC')
else:
  print('WA')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(input())
flg = 1
c_flg = 0
for i in range(len(a)):
    if i == 0:
        if a[0] != 'A':
            flg = 0
            break
    else:
        if 2 <= i <= len(a) - 2:
            if a[i] == 'C':
                c_flg += 1
            else:
                if a[i].isupper():
                    flg = 0
                    break
        else:
            if a[i].isupper():
                flg = 0
                break

if flg and c_flg == 1:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s=input()
if 'A' in s and 'C' in s[2:-1] and s[1:].replace('C','',1).islower()==True:
    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[1:].replace('C', '').islower():
  print('AC')
else:
  print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def valid(s):
    if s[0] != 'A':
        return False
    if s[2:-1].count('C') != 1:
        return False

    num_upper = 0
    for c in list(s):
        if c.isupper():
            num_upper += 1

    if num_upper > 2:
        return False

    return True


s = input().strip()
print('AC') if valid(s) else print('WA')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  S = input()
  flag1 = (S[0] == 'A')
  flag2 = (S[2:-1].count('C') == 1)
  flag3 = (S.replace('A', '').replace('C', '').lower()
           == S.replace('A', '').replace('C', ''))

  if flag1 and flag2 and flag3:
    print('AC')
  else:
    print('WA')


if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
s = str(input())
small = "qazwsxedcrfvtgbyhnujmikolp"
ans = "AC"

if s[0] != "A":
    ans = "WA"
    
if s[1] not in small:
    ans = "WA"
    
if s[-1] not in small:
    ans = "WA"
    
ccount = 0
for i in range(2,len(s)-1):
    if s[i] not in small:
        if s[i] == "C":
            ccount+=1
        else:
            ans = "WA"
            
if ccount != 1:
    ans = "WA"
    
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
S = input()

T = S.replace('A', '').replace('C', '')
if S[0] == 'A' and S[2:-1].count('C') == 1 and T.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() else "WA")

Submission status: Accepted

Solution code:
import sys
s = input()
judge = 0
if s[0] == "A":
    judge += 1

if s[1] != "C" and s[len(s) -1] != "C" and s.count("C") == 1:
    judge += 1

s = s.replace("A","a").replace("C","c")
#print(s,judge)
if s.islower() and judge == 2:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
import re
S = input()


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

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

if len(re.findall("[A-Z]", S)) != 2:
    print("WA")
    exit()

print("AC")

Submission status: Accepted

Solution code:

def referee(text):
    if text[0] != "A":
        return "WA"

    if text[1] == "C":
        return "WA"

    if text[1].isupper():
        return "WA"

    Cnum = 0

    for i in range(2, len(text)):
        if (text[i] == "C"):
            Cnum += 1
            if Cnum > 1:
                return "WA"
            continue

        if (text[i].isupper()):
            return "WA"

    if (text[-1] == "C"):
        return "WA"

    if (Cnum == 0):
        return "WA"

    return "AC"


if __name__ == "__main__":
    a = input()
    print(referee(a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

string  = input()

m = re.match('A[a-z]+C[a-z]+',string)

if m != None:
  if m.group() == string:
    print('AC')
    exit()
print('WA')

Submission status: Accepted

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

flag=False
slen=len(s)
s_3_2=s[2:slen-1]

if s[0]=="A":
    if s_3_2.count("C")==1:
        s=s.replace("A","")
        s=s.replace("C","")
        if s.islower():
            ans="AC"

print(ans)

Submission status: Accepted

Solution code:
S = input().rstrip()
flg = False
if S[0] == "A":
    flg = True
if flg:
    S_sep = S[2:-1]
    index = S_sep.find("C") + 2
    if index == 1:
        flg = False
if flg:
    for i in range(1, len(S)):
        if i != index:
            if S[i].isupper():
                flg = False

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

Submission status: Accepted

Solution code:
S=input()
S=list(S)
Check2=[]
Key=True

if S[0]!='A':
    Key=False

Check2=S[2:len(S)-1]
if Check2.count('C')!=1:
    Key=False

if Key==True:
    S.remove('A')
    S.remove('C')
    S=''.join(S)
    if str.islower(S)!=True:
        Key=False
    
if Key==True:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = list(input())

ans = 'AC'
length = len(s)

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

s[0] = 'a'
cnum = 0

for i in range(2,length-1):
    if s[i] == 'C':
        cnum = cnum + 1
        s[i] = 'c'
#print(cnum)
if cnum != 1:
    ans = 'WA'
strs = ''.join(s)
#print(strs)

if strs.islower() == False:
    ans = 'WA'

print(ans)

Submission status: Accepted

Solution code:
import sys

str = input()

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

str = str.replace('A', 'a', 1)

flag = False

for i in range(2, len(str) - 1) :
    if str[i] == 'C':
        str = str.replace('C' , 'c', 1)
        flag = True
        break
        
if not flag :
    print("WA")
    sys.exit()

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

Submission status: Accepted

Solution code:
import string

N = input()

if N[0] == 'A' and N.count('A') == 1 and N.count('C') == 1 and N[2:-1].count('C') == 1 and sum(1 for c in N if c.isupper()) == 2:
  print('AC')
else:
  print('WA')

Submission status: Accepted

Solution code:
s = input()
l = []
cnt = 0

for i in s:
    l.append(i)
if (l[0]=='A') and (l[2:-1].count('C')==1):
        idx =l[2:-1].index('C')
        idx += 2
        del l[idx]
        del l[0]
        for i in range(len(l)):
            if l[i].islower()==True:
                cnt += 1
        if cnt == len(l):
            print('AC')
        else:
            print('WA')
    
else:
    print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(S: str):
    a = S[0] == 'A'
    bs = list(filter(lambda x: x != 'C', S[2:-1]))
    cs = list(filter(lambda x: ord('A') <= ord(x) <= ord('Z'), [S[1]] + bs + list(S[-1:])))
    r =  a and len(bs) == (len(S[2:-1]) - 1) and len(cs) == 0
    return 'AC' if r else 'WA'


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
    result = solve(S)
    print(result)

if __name__ == '__main__':
    main()

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:
S = input()
memo = 0

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

Submission status: Accepted

Solution code:
def check(s):
    if s[0] != 'A':
        return False
    c = s.find('C')
    rc = s.find('C')
    if c != rc:
        return False
    if c < 2 or len(s)-1 <= c:
        return False
    return ''.join(sorted(s)[2:]).islower()

print(['WA','AC'][check(input())])

Submission status: Accepted

Solution code:
s=list(input())
if s[0]=="A" and s[2:len(s)-1].count("C")==1:
    s.remove("A")
    s.remove("C")
    print("AC" if str(s)==str(s).lower() else "WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
small  = [chr(i) for i in range(97,97+26)]
S = list(input())
n = len(S)
if S[0] != 'A' :
    print('WA')
else :
    cnt = 0
    for i in range(2,n-1) :
        if S[i] == 'C'  :
            cnt += 1

    if cnt != 1 :
        print('WA')
    else :
        c = 0
        for i in S :
            if i in small :
                c += 1
        
        if c != n-2 :
            print('WA')
        else :
            print('AC')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

s = list(input())



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

cnt = 0

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


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



del(s[index])
del(s[0])


s = ''.join(s)

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

Submission status: Accepted

Solution code:
A=list(input())
cnt = 0
if A[0] == "A":
    A[0]="a"
    if A[2:-1].count("C")==1:
        A[A.index("C")]="c"
        a="".join(A)
        if a.islower():
            cnt+=1
if cnt==1:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = list(input())
ans = "WA"
if s[0] == "A":
    if s[2:-1].count("C") == 1:
        s[0] = "a"
        s[s.index("C")] = "c"
        if "".join(s).islower():
            ans = "AC"
print(ans)

Submission status: Accepted

Solution code:
S = input()
AS = ''
flag = False
hereC = 0

if S[0]=='A' and S[2:-1].count('C') == 1:
    flag = True
    hereC = S[2:-1].find('C')+2
for i in range(1,len(S)):
    if i != hereC:
        AS += S[i]

if flag and AS.islower():
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
import sys
S = input()

string = ''
if S[0] == 'A':
    for i in range(len(S)):
        if (i > 1) and (i < (len(S) - 1)):
            string += S[i]
        #print(string)
    if string.count('C') == 1:
        #index = string.index('C')
        #newS = S.strip('C')
        newS = S.replace("C", "")
        #print(newS)

        if newS[1:].islower():
            print('AC')
            sys.exit()

print('WA')

Submission status: Accepted

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

print("WA")

Submission status: Accepted

Solution code:
import sys

s = input()
C_count = 0

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

if C_count != 1:
    print('WA')
    sys.exit()
else:
    print('AC')

Submission status: Accepted

Solution code:
S=input()
if S[0]=='A':
    if S[2:-1].count('C')==1:
        i = S.index('C')
        tmp = S[1:i]+S[i+1:]
        tmp_low=tmp.lower()
        print('AC' if tmp==tmp_low else 'WA')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = str(input())
t = s[2:-1]
a = 0
for i in s:
    if i.isupper():
        a += 1
if s[0] == "A" and t.count("C") == 1 and a == 2:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
a = input()
b = a[2:-1]
if a.startswith("A"):
    if b.count("C") == 1:
        c = list(a)
        c.remove("A")
        c.remove("C")
        for i in c:
            if i.isupper():
                print("WA")
                exit()
        print("AC")
        exit()
print("WA")

Submission status: Accepted

Solution code:
# ABC104B - AcCepted
s = input().rstrip()
if (
    s[0] == "A"
    and s[2:-1].count("C") == 1
    and s.translate(str.maketrans({"A": None, "C": None})).islower()
):
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
# ABC104B - AcCepted
s = input().rstrip()
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:
import sys

S = str(input())

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

temp = S.replace('A', '').replace('C', '')
if temp.islower():
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = input()
ans = "AC"
tmp = 0
if S[0] != "A":
	ans = "WA"
for i in range(2, len(S) - 1):
	if S[i] == "C":
		tmp += 1
if tmp != 1:
	ans = "WA"
if not S.replace("A", "").replace("C", "").islower():
	ans = "WA"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

print(["AC", "WA"][not("A" == S[0] and 1 == S[2:-1].count("C") and (S[1] + S[2:-1].replace("C", "") + S[-1]).islower())])

Submission status: Accepted

Solution code:
S = input()

ans = 'AC'
count = 0
for i in range(len(S)):
    if i==0 and S[i] != 'A':
        ans = 'WA'
        break
    if i!=0 and S[i] != 'C' and S[i].isupper():
        ans = 'WA'
        break
    if (2 <= i <= len(S)-2) and S[i] == 'C':
        count += 1

if 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 S[1:].replace('C', '').islower():
  print('AC')
else:
  print('WA')

Submission status: Accepted

Solution code:
def chk(s):
    if s[0]!="A" or s[2:len(s)-1].count("C")!=1: return "WA"
    l=s.index("C")
    for i in range(len(s)):
        if i not in [0,l] and s[i] not in "abcdefghijklmnopqrstuvwxyz": return "WA"
    return "AC"
    


s=input()

print(chk(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
flag = True
if S[0] != 'A':
    flag = False
elif 'C' not in S[2:len(S)-1]:
    flag = False
s2 = S.replace('C', '', 1)
if 'C' in s2:
    flag = False
    
if flag:
    s2 = s2.replace('A', '', 1)
    if s2.islower():
        flag = True
    else:
        flag = False
if flag:
    print('AC')
else:
    print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

chrs = set() #先頭、3~last-1のCを覗いた文字の集合

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

ccnt = 0 #3~last-1までのCの数
for c in S[2:len(S)-1]:
  if c == 'C': ccnt += 1

if ccnt != 1:
  print('WA')
  exit()
  
#残りの文字を集合に入れる
chrs.add(S[1:2]) #2文字目を追加
for c in S[2:len(S)-1]: #3~last-1を追加
  chrs.add(c)
chrs.remove('C') #正しいCが入っちゃったのでそれは除く
chrs.add(S[len(S)-1:len(S)])

#集合に大文字があればWA
for ng in range(ord('A'), ord('Z')+1, 1):
  if chr(ng) in chrs:
    print('WA')
    exit()
    
#AC
print('AC')

Submission status: Accepted

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

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

  C_counter = 0
  for n in s[2:-1]:    
    if n == 'C':
      C_counter += 1

  if C_counter != 1:
    print('WA')
    return

  for n in s:
    if n == 'A' or n == 'C':
      continue
    if not n.islower():
      print('WA')
      return
  print('AC')
  return




main()

Submission status: Accepted

Solution code:
S=input()
if S[0]=='A':
    f1=True
else:
    f1=False

count=0
for s in S[2:-1]:
    if s=="C":
        count+=1
if count==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:
s = input()

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

Submission status: Accepted

Solution code:
s=input()
ans=0
if s[0]=='A':
  ans+=1
  s=s[1:]
if 'C' in s[1:-1]:
  ans+=1
  for i in range(1,len(s)-1):
    if s[i]=='C':
      s=s[:i]+s[i+1:]
      break
count=0
for i in range(len(s)):
  if s[i] in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
    count+=1
if count==0:
  ans+=1
print("AC" if ans==3 else "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:
    S = S.replace("A", "")
    S = S.replace("C", "")
    if all([ord(c) >= 97 for c in S]):
        print("AC")
        quit()
print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
	S = input()
	ac = S[0] == "A"
	ac = ac and S[2:-1].count("C") == 1
	ac = ac and S.replace("A", "").replace("C", "") == S.replace("A", "").replace("C", "").lower()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#104 B
S =input()

if S[0]=="A" and S[2:len(S)-1].count('C')==1 and S.replace('A',"").replace('C',"")==S.replace('A',"").replace('C',"").lower():
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
import sys

s = input()

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

print("WA")