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:
def main():
    S = input()
    if S[0] != 'A':
        print('WA')
        exit()
    if S[2:-1].count('C') != 1:
        print('WA')
        exit()
    s = list(S)
    s[0] = 'a'
    ci = 2 + S[2:-1].index('C')
    s[ci] = 'c'
    if ''.join(s) != S.lower():
        print('WA')
        exit()
    print('AC')


main()

Submission status: Accepted

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

def main():
    s = input()
    flag = True
    if s[0] != "A":
        flag = False
    if "C" not in s[2:-1]:
        flag = False
    if count_upper(s) != 2:
        flag = False
    print("AC" if flag else "WA")

def count_upper(s):
    upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    assert len(set(upper)) == 26
    res = 0
    for c in s:
        if c in upper:
            res += 1
    return res

main()

Submission status: Accepted

Solution code:
""" AtCoder """

S = input()
count = 0

if S[0] == 'A':
    if S[2:-1].count('C') == 1:
        for c in S:
            if c.isupper():
                count += 1
        if count == 2:
            print("AC")
            exit()
print("WA")

Submission status: Accepted

Solution code:
s = input()
ok = True
uppercount = 0
for c in s:
    if c.isupper():
        uppercount += 1
        
if s[0] == 'A' and s[2:-1].count('C') == 1 and uppercount == 2:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = input()

flag = 0


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

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


count =0
s_small = s.lower()
for i in range(len(s)):
  if s_small[i] !=s[i]:
    count += 1

if count !=2:
  flag =1
  
print("AC" if flag ==0 else "WA")

Submission status: Accepted

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

def main():
    S = input()

    f = False

    if S[0] == 'A':
        if S.count('C') == 1:
            i = S.index('C')
            if 2 <= i and i < len(S) - 1:
                if S[1:i].islower() and S[i+1:].islower():
                    f = True


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
cnt = 0
if S[0] == "A":
  cnt += 1
  del S[0]
if  "C" in S[1:-1]:
  cnt += 1
  S.remove("C")
if  "C" in S[1:-1]:
  cnt -= 1
  S.remove("C")
if ("".join(S)).islower():
  cnt += 1
if cnt == 3:
  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:
    flag = True
    s = s.replace("A", "").replace("C", "")
    if s.islower() != True:
        print("WA")
    else:
        print("AC")

Submission status: Accepted

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

    if s[0] == "A":
        s1 = s[2:-1]
        if s1.count("C") == 1:
            s2 = re.sub(r'[a-z]', '', s)
            if len(s2) == 2:
                print("AC")
                return
    print("WA")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()

ans = 'WA'
if S[0] == 'A' and S[2:-1].count('C') == 1 and S[1] != 'C' and S[-1] != 'C':
    S2 = S.replace('A', 'a')
    S3 = S2.replace('C', 'c')
    if S3 == S.lower():
        ans = 'AC'
    
print(ans)

Submission status: Accepted

Solution code:
import re 
s = input()
ans = "WA"
if s[0]=="A":
    if s[2:-1].count("C") == 1:
        if len(re.findall("[A-Z]",s)) == 2:
            ans = "AC"
print(ans)

Submission status: Accepted

Solution code:
import re 
s = input()
a = "WA"
if s[0] == "A":
    if s[2:-1].count("C") == 1:
        if len(re.findall("[A-Z]",s)) == 2:
            a = "AC"
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!usr/bin/env python3
def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()
def LIR(n): return [LI() for i in range(n)]

#A
s = S()
if s[0] != "A":
    print("WA")
else:
    count = []
    for i in range(2,len(s)-1):
        if s[i] == "C": count.append(i)
    if len(count) != 1:
        print("WA")
    else:
        for i in range(1,len(s)):
            if i not in count:
                if s[i] == s[i].upper():
                    print("WA")
                    quit()
        print("AC")
#B

#C

#D

#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T

Submission status: Accepted

Solution code:
a=input()
d=["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"]
c=0
t=len(a)
if a[0]=="A":
    p=a[2:-1]
    if "C" in p:
        k=a[1:]
        t-=1
        q=0
        for i in range(t):
            if k[i]in d:
                q+=1
        if t-1==q:
            c=1
print("WA"if c!=1else"AC")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(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()
ans = 'WA'

if s[0] == 'A':
    if s[2:-1].count('C') == 1:
        flag = 0
        for i in range(1,len(s)):
            if s[i].isupper():
                flag += 1
        if flag == 1:
            ans = 'AC'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

if S[0] == "A" :
    if S[2:-1].count("C") == 1 :
        a = list(S)
        a.remove("C")
        s = "".join(a[1:])
        if s.islower()==True:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
S = list(input().rstrip())

if S[0] == 'A':
	S[0] = 'a'
	cnt = 0
	flag = True
	for i, s in enumerate(S[2:-1]):
		if s == 'C':
			cnt += 1
			if flag:
				S[2+i] = 'c'
				flag = False
	if cnt == 1 and ''.join(S).islower():
		print('AC')
		exit(0)

print('WA')

Submission status: Accepted

Solution code:
import re

s = input()
if s[0] != "A":
    print("WA")
elif s[2:-1].count("C") != 1:
    print("WA")
else:
    i = 2 + s[2:-1].index("C")
    print("AC" if re.match("^[a-z]*$", s[1] + s[2:i] + s[i+1:]) else "WA")

Submission status: Accepted

Solution code:
def piyo():
    s = list(str(input()))
    c = 0
    a = 0
    if s[0]!="A":
        return "WA"
    if s[1]=="C" or s[len(s)-1]=="C":
        return "WA"
    for hage in s:
        if hage!="A" and hage!="C":
            if hage.isupper():
                return "WA"
        if hage=="C":
            c+=1
        if hage=="A":
            a+=1
    if c>1 or c==0:
        return "WA"
    if a>1:
        return "WA"
    return "AC"
        
if __name__ == '__main__':
    hoge=piyo()
    print(hoge)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = input()
f = False
for i,c in enumerate(s):
    if i == 0:
        if c != 'A':
            print('WA')
            exit()
    elif i == 1 or i == len(s) - 1:
        if ord('A') <= ord(c) <= ord('Z'):
            print('WA')
            exit()
    elif c == 'C':
        if f:
            print('WA')
            exit()
        f = True
    elif ord('A') <= ord(c) <= ord('Z'):
        print('WA')
        exit()
if f:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = input()
#a = [int(i) for i in input().split()]
#s = [[int(j) for j in input().split()] for i in range(N)]

res = True
if S[0]!='A':
    res = False
if S[2:-1].count('C')!=1:
    res = False
cnt = 0
for c in S:
    if ord('a')<= ord(c) and ord(c) <= ord('z'):
        cnt+=1
if cnt!=len(S)-2:
    res=False


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

Submission status: Accepted

Solution code:
s = input()

count=0
ans=0
if(s[0]=='A'):
    if(s[2:-1].count('C') == 1):
        for i in range(1, len(s)):
            if(97 <= ord(s[i]) <= 122):
                continue
            else:
                count+=1
            if(count>1):
                print("WA")
                ans+=1
                break
    else:
        print("WA")
        ans+=1
else:
    print("WA")
    ans+=1

if(ans==0):
    print('AC')

Submission status: Accepted

Solution code:
# coding: utf-8
S = input()

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

Submission status: Accepted

Solution code:
# coding: utf-8
S = input()

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

Submission status: Accepted

Solution code:
S = str(input())
s = S[2:len(S)-1]
k = s.count("C")
def main(S):
    C_index = S.find("C")
    S = S[1:C_index]+S[C_index+1:]
    if S.lower() == S:
        return 1
    else:
        return 0

if S[0] != "A":
    print("WA")
elif k > 1 or k == 0:
    print("WA")
elif main(S) == 0:
    print("WA")
else:
    print("AC")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())
L = S[2:-1]
M = S.replace("A","").replace("C","")
if S.find("A") == 0:
    if L.count("C") == 1:
        if M.lower() == M:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = str(input())
flag = 0
flag2 = 0
if s[0] == 'A':
    for i in range(2,len(s)-1):
        if s[i] == 'C':
            flag += 1
    for i in range(1,len(s)):
        if s[i] == s[i].upper():
            flag2 += 1
#print(flag,flag2)
if flag == 1 and flag2 == 1:
    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:
        ans = "AC"
        for i in range(len(S)):
            if i==0:
                continue
            if S[i]=="C":
                continue
            if S[i].isupper():
                ans = "WA"

print(ans)

Submission status: Accepted

Solution code:
S=input()

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

kaburi=False
for i in range(len(S)):
    #print(i)
    if S[i].isupper() and i>0:
        if S[i]=='C' and i>=2 and i<=(len(S)-2) and not kaburi:
            kaburi=True
            like_Center_C_flag=True
        else:
            print ( 'WA' )
            exit ( 0 )
if kaburi:
    print ( 'AC' )
else:
    print('WA')

Submission status: Accepted

Solution code:
S = input()
flag = True
if S[0] != 'A':
    flag = False
if S[2:len(S)-1].count('C') != 1:
    flag = False
S = S[1:].replace('C', 'c')
if S.islower() and flag is True:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = list(input())
ac = True
c = False
for i in range(len(s)):
    if i == 0:
        if s[i] != 'A':
            ac = False
    else:
        if not('a' <= s[i] <= 'z'):
            if (s[i] == 'C' and c == False and 2 <= i <= len(s)-2):
                c = True
            else:
                ac = False
print(['WA','AC'][ac and c])

Submission status: Accepted

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


def main():
    """Function."""
    s = str(input())

    flag1, flag2, flag3 = 0, 0, 0
    if s[0] == "A":
        flag1 = 1

    c_site = 0
    if s[2:-1].count("C") == 1:
        flag2 = 1
        c_site = list(s[2:-1]).index("C") + 2

    if flag2 == 1:
        check = s[1:c_site] + s[c_site+1:]
        if check.islower():
            flag3 = 1

    if (flag1, flag2, flag3) == (1, 1, 1):
        print("AC")
    else:
        print("WA")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B AcCepted
b = input()
a = list(b)
c=z = len(b)
d =""
if a[0] == "A":
    a[0] = "a"
    c = 10000
for i in range(2,z-1):
    if a[i] == "C":
        a[i]="c"
        c+=1
for i in a:
    d+=i
if d.islower() and c == 10001:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
S = input()


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

elif "C" in S:
    a = S.index("C")

    if 2 <= a <= len(S)-2:
        S = S.replace("A", "", 1).replace("C", "", 1)
        
        if S.islower():
            print("AC")
        
        else:
            print("WA")

    else:
        print("WA")

else:
    print("WA")

Submission status: Accepted

Solution code:
from collections import Counter


def ac(s):
    if s[0] != 'A':
        return False

    cs = Counter(s[2:-1])
    if cs['C'] != 1:
        return False

    cs.pop('C')
    return s[1].islower() and s[-1].islower() and all(c.islower() for c in cs.keys())


def main():
    s = input()
    if ac(s):
        print('AC')
    else:
        print('WA')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

S = input()

res = True

if S[0] != 'A':
  res = False
  
if S[2:-1].count('C') != 1:
  res = False
  
if len(re.findall('[a-z]', S)) != len(S) - 2:
  res = False
       
if res:
  print('AC')
else:
  print('WA')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

judge = "AC"
if S[0] != "A":
	judge = "WA"
else:
	if s.count("C") != 1:
		judge = "WA"
	else:
		S = S.replace("A", "")
		S = S.replace("C", "")
		ch = "Yes"
		for i in S:
			if ord(i) <= 96:
				ch = "No"
		if ch == "No":
			judge = "WA"

print(judge)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

if (s[0] == 'A' and 'C' in s[2:-1] and len([x for x in s if x.islower()]) == len(s) - 2):
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
S = input()
Sl = [i for i in S]
Slen = len(Sl)
Cv = S.find("C")
C = Sl.pop(Cv)
A = Sl.pop(0)
lo = "".join(Sl)

if A == "A" \
and C == "C" \
and lo.islower() == True \
and 2 <= Cv < (Slen-1):
    print("AC")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def abc104_b():
    s = input()
    num = s.find("C")
    if s[0] == "A" and s[2:-1].count("C") == 1 and (s[1:num] + s[num + 1:]) == (s[1:num] + s[num + 1:]).lower():
        print("AC")
    else:
        print("WA")


abc104_b()

Submission status: Accepted

Solution code:
S = input()
cond1 = S[0] == 'A'
cond2 = S[2:-1].count('C') == 1
cond3 = S[1:].replace('C', '').islower()
flag = cond1 * cond2 * cond3
print('WAC'[flag:][:2])

Submission status: Accepted

Solution code:
S = input()
ans = 'AC'
if S[0] != 'A' or S[2:-1].count('C') != 1:
    ans = 'WA'
else:
    for i in range(len(S)):
        if i == 0:
            continue
        elif (2 <= i <= len(S)-2) and S[i] == 'C':
            continue
        else:
            if not ('a' <= S[i] <= 'z'):
                ans = 'WA'
                break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

S = input()
matchObj = re.match(r'^A[a-z]+C{1}[a-z]*[a-z]$', S)
if matchObj:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = input()
c1, c2, c3 = False, False, False
#print(c1, c2, c3)
import re
#print(s[2:-1])

if s[0] == "A":
  c1 = True
if s[2:-1].find("C") >= 0:
  c2 = True
if len(re.findall("[a-z]", s)) == len(s)-2:
  c3 = True
#print(c1, c2, c3)
#print(len(re.findall("[a-z]", s)))

if c1 and c2 and c3:
  print("AC")
else:
  print("WA")

Submission status: Accepted

Solution code:
S = input()
cond1 = S[0] == 'A'
cond2 = S[2:-1].count('C') == 1
cond3 = S[1:].replace('C', '', 1).islower()
flag = cond1 * cond2 * cond3
print('WAC'[flag:][:2])

Submission status: Accepted

Solution code:
def main():
    s = list(input())
    s_len = len(s)
    if s[0] != "A":
        print("WA")
        return
    elif s[1] == "C":
        print("WA")
        return
    elif s[s_len-1] == "C":
        print("WA")
        return
    c_counter = 0

    for i in range(2, s_len - 1):
        if(s[i] == "C"):
            if(c_counter == 1):
                print("WA")
                return
            c_counter += 1
    for i in range(s_len):
        if(s[i].isupper()):
            if(s[i] != "A" and s[i] != "C"):
                print("WA")
                return
    if(c_counter == 0):
        print("WA")
        return

    print("AC")
main()

Submission status: Accepted

Solution code:
s=list(input())

flag=0
#cnt1=0
#cnt2=0
if ord(s[0])==65 and 65+32<=ord(s[1])<=90+32 and 65+32<=ord(s[-1])<=90+32:
  flag=1
  for i in range(2,len(s)-1):
    if ord(s[i])==67:
      flag+=1
  
print('AC' if flag==2 else 'WA')

Submission status: Accepted

Solution code:
s=list(input())

flag=0
cnt1=0
cnt2=0
if ord(s[0])==65 and 65+32<=ord(s[1])<=90+32 and 65+32<=ord(s[-1])<=90+32:
  flag=1
  for i in range(2,len(s)-1):
    if ord(s[i])==67:
      flag+=1
  
print('AC' if flag==2 else 'WA')

Submission status: Accepted

Solution code:
s = str(input())
if s[0] == 'A' and s[2:-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()

c1, c2 = False, False

if s[0] == 'A':
    c1 = True

if s[2:-1].count('C') == 1:
    c2 = True

s_lower = s[1:].replace('C', 'c')
c3 = s_lower.islower()

if c1 and c2 and c3:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = input()

mid = S[2:-1]
C_count = 0

for i in mid:
    if i == 'C':
        C_count += 1
        
S_lower = S.lower()
S_replace = S.replace('A', 'a').replace('C', 'c')
        
if S[0] == 'A' and C_count == 1 and S_lower == S_replace:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s=input()
x=len(s)
d='abcdefghijklmnopqrstuvwxyz'
sum=0
count=0
ans='WA'
if s[0]=='A':
  for i in range(2,x-1):
    if s[i]=='C':
      sum+=1
  if sum==1:
    for i in range(1,x):
      for j in range(26):
        if s[i]==d[j]:
          count+=1
    if count==x-2:
      ans='AC'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

import re


def solve():
    S = input()

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

    print('WA')


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
def main() :
	S = input()
	if (S[0] != "A") :
		print("WA")
		return
	
	if (list(S).count("A") != 1) :
		print("WA")
		return
	
	S2 = list(S[2:-1])
	if (S2.count("C") != 1) :
		print("WA")
		return
	
	for s in list(S) :
		if (s == "A" or s == "C") :
			continue
		
		if (s.isupper()) :
			print("WA")
			return
	
	print("AC")


main()

Submission status: Accepted

Solution code:


def ac(S):
    if S[0] != "A":
        return False
    C = S.find("C")
    if C <= 1 or C == len(S)-1:
        return False
    for c in (S[1:C] + S[C+1:]):
        if c.isupper():
            return False
    return True


def main():
    S = input()
    if ac(S):
        print("AC")
    else:
        print("WA")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S = input()

count = 0
ans = True

if S[0] != "A":
    ans = False
if not "C" in S[2:-1]:
    ans = False
for s in S:
    if s.isupper():
        count += 1
if count > 2:
    ans = False

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

Submission status: Accepted

Solution code:
S = input()

ans = True

if(S[0] != "A"):
    ans = False
if not "C" in S[2:-1]:
    ans = False
count = 0
for c in S:
    if c.isupper():
        count += 1

if count > 2:
    ans = False

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

Submission status: Accepted

Solution code:
from collections import Counter

def is_lower_case(c):
  lower_case_alphabets = 'abcdefghijklmnopqrstuvwxyz'
  return c in lower_case_alphabets

S = input()
cnt = Counter(S[2:-1])

flag = True
if S[0] != 'A':
  flag = False
if cnt['C'] != 1:
  flag = False
for c in S[1:]:
  if c != 'C' and not is_lower_case(c):
    flag = False
print('AC' if flag else 'WA')

Submission status: Accepted

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

    if s[0] != "A" or s[1].isupper() or s[-1].isupper():
        print("WA")
        return

    num_c = 0
    num_cap = 0
    for l in s[2:-1]:
        if l == "C":
            num_c += 1
        if l.isupper():
            num_cap += 1
    if num_c == 1 and num_cap == 1:
        print("AC")
    else:
        print("WA")

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S = input()
S_len = len(S)
S_list = list(S)
fin_S = ''
# if S[0] == 'A' and 'C' in S[2:S_len-1]:

if S_list[0] == 'A':
    S_list[0] = 'a'
    #print(S[2:S_len-1])
    if 'C' in S[2:S_len-1]:
        C_index = S.index('C')
        #print(C_index)
        if 2 <= C_index < S_len-1:
            S_list[C_index] = 'c'
            for i in range(S_len):
                fin_S+=S_list[i]
                #print(fin_S)

if fin_S.islower():
    print('AC')
    exit()

print('WA')

Submission status: Accepted

Solution code:
from collections import Counter

s = input()

flag = 1
if not s[0] == "A":
    flag = 0

c = Counter(s[2:-1])
if not c["C"] == 1:
    flag = 0

small = set([chr(i) for i in range(ord("a"), ord("z") + 1)])

for i, w in enumerate(s):
    if (i == 1 or i == len(s)-1) and not(w in small):
        flag = 0

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

Submission status: Accepted

Solution code:
T = []
for i in range(ord("a"),ord("z")+1) :
    T.append(chr(i))

L = list(input())
counter = 0
flag = 0
for i in range(len(L)) :
    if i == 0 :
        if L[i] != "A" :
            ans = -1
            break
    elif i == 1 :
        if L[i] not in T :
            counter += 1
    elif 2 <= i <= len(L)-2 :
        if L[i] not in T and flag == 1 :
            counter += 1
        elif flag == 0 and L[i] == "C" :
            flag = 1
    else :
        if L[i] not in T :
            counter += 1
if counter > 0 or flag == 0 :
    print("WA")
else :
    print("AC")

Submission status: Accepted

Solution code:
S = input()

if S[0] == "A" and "C" in [str(a) for a in S[2:-1]]:
    t = 0
    for a in S:
        if a.isupper():
            t += 1
    if t == 2:
        print("AC")
        exit(0)
print("WA")

Submission status: Accepted

Solution code:
s = str(input())
if s[0] != "A":
    print("WA")
    exit()
cou = 0
for i in range(1,len(s)):
    num = ord(s[i])-ord("a")
    if 0 <= num and num <= 25:
        continue
    else:
        if s[i] == "C":
            if i == 1 or i == len(s)-1:
                print("WA")
                exit()
            else:
                cou += 1
        else:
            print("WA")
            exit()
if cou == 1:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

sys.setrecursionlimit(10**5)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

def judge(s:list) -> bool:
    
    if not s[0] == 'A':
        return False
        
    if not 'C' in s[2:-1]:
        return False
        
    s.remove('C')
    s.remove('A')
    
    for si in s:
        if not 'a' <= si <= 'z':
            return False
            
        
    return True


s = lc()

ac = judge(s)
print('AC') if ac else print('WA')

Submission status: Accepted

Solution code:
S = input()
def ok(s):
    if s[0] != 'A':
        return False
    elif s[2:-1].count('C') != 1:
        return False
    upper = 0
    for c in s:
        if c.isupper():
            upper += 1
    if upper != 2:
        return False
    return True

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
n=len(S)
if S[0]=="A":
	if 2<=S.find("C")<=n-2:
		T=S.lstrip("A")
		R=T.replace("C","c",1)
		Q=T.replace("C","c")
		if R==Q:
			if R.lower()==R:
				print("AC")
				exit()
print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
N = list(input())
komoji = 0
oomoji = 0
if N[0] == 'A':
    if N[1].islower():
        for i in range(2, len(N)-1):
            if N[i] == 'C':
                oomoji += 1
            if N[i].islower():
                komoji += 1
        if N[-1].islower():
            komoji += 1
if oomoji == 1 and komoji == len(N) - 3:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
c = False
for e,i in enumerate(s):
    if e == 0:
        if not i == "A":
            print("WA")
            break
    elif 1 < e < n-1 and i == "C":
        if not c:
            c = True
        else:
            print("WA")
            break
    else:
        if not i in "abcdefghijklmnopqrstuvwxyz":
            print("WA")
            break
else:
    if c:
        print("AC")
    else:
        print("WA")

Submission status: Accepted

Solution code:
import re


s = input()
if s[0] == "A" and s[2:-1].count("C") == 1 and len(re.findall('[A-Z]', s)) == 2:
    print("AC")
else:
    print("WA")