Problem:


Score : 200 points

Problem Statement

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

The initial character of S is an uppercase A.

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

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

Constraints

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

Each character of S is uppercase or lowercase English letter.

Input

Input is given from Standard Input in the following format:

S

Output

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

Sample Input 1

AtCoder

Sample Output 1

AC

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

Sample Input 2

ACoder

Sample Output 2

WA

The second letter should not be C.

Sample Input 3

AcycliC

Sample Output 3

WA

The last letter should not be C, either.

Sample Input 4

AtCoCo

Sample Output 4

WA

There should not be two or more occurrences of C.

Sample Input 5

Atcoder

Sample Output 5

WA

The number of C should not be zero, either.



Sample input:
AtCoder


Sample output:
AC

Submission status: Accepted

Solution code:
import re
import sys
S = input()
flg = 0
upperReg = re.compile(r'^[A-Z]+$')

def isupper(s):
    return upperReg.match(s) is not None

if S[0] != "A":
    print("WA")
    sys.exit()
if isupper(S[1]) == True:
    print("WA")
    sys.exit()

for j in range(2,len(S)):
    if isupper(S[j]) == True:
        if flg == 1:
            print("WA")
            sys.exit()
        else:
            if S[j] == "C":
                if len(S) == 4:
                    if j != 2:
                        print("WA")
                        sys.exit()
                    flg = 1
                else:
                    if 2 <= j <= len(S) - 2:
                        flg = 1

                    else:
                        print("WA")
                        sys.exit()

if flg != 1:
    print("WA")
    sys.exit()

print("AC")

Submission status: Accepted

Solution code:
import sys

s = input()

hasC = False
hasA = False
for i in range(len(s)):
    if i == 0 and s[i] == 'A' and not hasA:
        hasA = True
        continue
    if i >= 2 and i <= len(s)-2 and s[i] == 'C' and not hasC:
        hasC = True
        continue
    if s[i].islower(): continue

    print("WA")

    sys.exit()


if hasC and hasA: print("AC")
else : print("WA")

Submission status: Accepted

Solution code:
S = input()

if S[0] != "A":
    print("WA")
else:
    listC = []
    for i in range(2,len(S)-1):
        if S[i] == "C":
            listC.append(i)
    if len(listC) != 1:
        print("WA")
    else:
        listS = list(S)
        listS.pop(listC[0])
        listS.pop(0)
        S = "".join(listS)
        if S.islower():
            print("AC")
        else:
            print("WA")

Submission status: Accepted

Solution code:
def check(s):
    t=True
    if s[0]!="A" :
        t=False
        #print("reached")
    a=s[2:len(s)-1]
    #print(a)
    count=0
    for i in range(len(a)):
        if a[i]=="C":
            count+=1
    if count!=1:
        t=False
    alph="BDEFGHIJKLMNOPQRSTUVWXYZ"
    for i in range(24):
        if alph[i] in s:
            t=False
            break
    if t:
        print("AC")
    else:
        print("WA")
s=input()
check(s)

Submission status: Accepted

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

def main():
    s = input()

    if s[0] == 'A':
        s = s.replace('A', 'a', 1)
        if s[2:-1].count('C') == 1:
            temp = s[2:-1].replace('C', 'c', 1)
            ans = s[:2] + temp + s[-1]
            if ans.islower():
                print('AC')
                exit()
    print('WA')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
ss = str(input())
s = list(ss)

if s[0] == "A" and s.count("A") == 1:
    checklist = []
    for i in range(2,len(s)-1):
        checklist.append(s[i])
        
    if checklist.count("C") == 1:
        s.remove("A")
        s.remove("C")
        p = ""
        for i in s:
            p = p + i
        if p.islower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = str(input())
s_list = list(s)
ans_1 = 'no'
ans_2 = 'no'
ans_3 = 'ok'
check = 'no'
s_list_len = len(s_list)
if s_list[0] == 'A':
    ans_1 = 'ok'
count = 0
for i,j in enumerate(s_list[2:s_list_len-1]):
    if j == 'C':
        count += 1
        if check == 'no':
            s_list.pop(2+i)
        check = 'yes'
if count == 1:
    ans_2 = 'ok'
for i in s_list[1:]:
    if not i.islower():
        ans_3 = 'no'
if (ans_1 == 'ok') and (ans_2 == 'ok') and (ans_3 == 'ok'):
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
#coding:utf-8
s=input()
count=True
dumy=0
for i in range(len(s)):
  if(s[i]>="A" and s[i]<="Z"):
    dumy+=1
if(dumy!=2):
  count=False
dumy=0
if(s[0]=="A"):
  for i in range(2,len(s)-1):
    if(s[i]=="C"):
      dumy+=1
else:
  count=False
if(dumy!=1):
  count=False
if(count==False):
  print("WA")
else:
  print("AC")

Submission status: Accepted

Solution code:

s=list(input())

f=1

if not s[0]=="A":
    f=-1

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

c=0

for i in range(len(b)):
    if b[i]=="C":
        c+=1
    else:
        if not b[i].islower():
            f=-1

if not c==1:
    f=-1

if not s[1].islower():
    f=-1
  
if not s[len(s)-1].islower():
    f=-1
      
if f>0:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
S = input()
# tempS= S
temp = S[2:-1]
count_c=temp.count("C")
if S[0] == "A" and count_c == 1:
    tempS=list(S)
    del tempS[0]
    del tempS[tempS.index("C")]
    tempS = "".join(tempS)
    if tempS.islower():
        print("AC")
    else:
        print("WA")
    # print(tempS)
    # print(count_c)
else:
    print("WA")
    # tempS = S[1:]
    # tempS = tempS.strip("C")
    # tempS = tempS.lstrip("A")
# print(type(tempS))
# for i in range

Submission status: Accepted

Solution code:
def main():
  S = input()
  
  if S[0] != 'A':
    print("WA")
    return
  if S[1].isupper() or S[-1].isupper():
    print("WA")
    return
  cnum = 0
  for i in S[1:-1]:
    if i == 'C':
      cnum +=1
    elif i.isupper():
      print("WA")
      return
  if cnum == 1:
    print("AC")
  else:
    print("WA")

main()

Submission status: Accepted

Solution code:
s = input()

if s[0] == 'A' and s[2:-1].count('C') == 1:
    c_idx = s[2:-1].index('C') + 2
    ss = [c for c in s]
    ss[0] = ''
    ss[c_idx] = ''
    s = ''.join(ss)
    if s.islower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

Solution code:
import re

point1 = 0
count1 = 0
point2 = 0
point3 = 0
	
S = input()
l = len(S)
if S[0]=='A':
	point1+=1
for n in range(2,l-1):
	if S[n]=='C':
		count1+=1
if count1==1:
	point2+=1
	
SS = re.sub("A","",S)
SS = re.sub("C","",SS)
if SS.islower():
	point3+=1
	
xx = point1+point2+point3

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

Submission status: Accepted

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

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

    count = 0
    for i in range(2, len(S)-1):
        if S[i] == "C":
            count += 1
            c_i = i
            continue
    if count != 1:
        print("WA")
        exit()

    for i in range(1, len(S)):
        if i == c_i:
            continue
        if not (97 <= ord(S[i]) and ord(S[i]) <= 122):
            print("WA")
            exit()

    print("AC")

Submission status: Accepted

Solution code:
class Solution:

    def check(self):
        s = input()
        if s[0] != "A":
            return 'WA'
        if s[2:len(s) - 1].count("C") != 1:
            return "WA"
        ncount = 0
        for i in s:
            if "A" <= i <= "Z":
                ncount += 1
        if ncount > 2:
            return "WA"
        return "AC"


print(Solution().check())

Submission status: Accepted

Solution code:
s = input()

s_list=list(s)

C_num=-1

if (s_list[0]!="A"):
  print("WA")
else:
  nagasa=len(s_list)

  num=0
  for i in range(2,nagasa-1):
    if s_list[i]=="C":
      num += 1
      C_num=i

  if num!=1:
    print("WA")
  else:
    del s_list[0]
    del s_list[C_num-1]
    mojiretu = ''.join(s_list)
    if(mojiretu.islower()==True):
      print("AC")
    else:
      print("WA")

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

s = ns().rstrip()
ok = False
if s.startswith("A"):
    if s[2:-1].count("C") == 1:
        ct = 0
        for c in s:
            if "a" <= c <= "z":
                ct += 1
        if ct == len(s)-2:
            ok = True
print("AC" if ok else "WA")

Submission status: Accepted

Solution code:
s = input()
flag = 0
flag1 = 0
flag2 = 0
count1 = s.find('A')
if count1 == -1:
	flag = 1
if flag == 0:
	if s.index('A') != 0:
		flag = 1
if flag == 0:
	s = '1' + s[1:]

count2 = s.find('C')
if count2 > 1 and count2 < len(s) - 1: 
	flag1 = 0
else:
	flag1 = 1

if flag1 == 0:
	s = s[:count2] + '2' + s[count2 + 1:]


if s.find('A') != -1:
	flag2 = 1
if s.find('C') != -1:
	flag2 = 1
if s.find('B') != -1:
	flag2 = 1
if s.find('D') != -1:
	flag2 = 1
if s.find('E') != -1:
	flag2 = 1
if s.find('F') != -1:
	flag2 = 1
if s.find('G') != -1:
	flag2 = 1
if s.find('H') != -1:
	flag2 = 1
if s.find('I') != -1:
	flag2 = 1
if s.find('J') != -1:
	flag2 = 1
if s.find('K') != -1:
	flag2 = 1
if s.find('L') != -1:
	flag2 = 1
if s.find('M') != -1:
	flag2 = 1
if s.find('N') != -1:
	flag2 = 1
if s.find('O') != -1:
	flag2 = 1
if s.find('P') != -1:
	flag2 = 1
if s.find('Q') != -1:
	flag2 = 1
if s.find('R') != -1:
	flag2 = 1
if s.find('S') != -1:
	flag2 = 1
if s.find('T') != -1:
	flag2 = 1
if s.find('U') != -1:
	flag2 = 1
if s.find('V') != -1:
	flag2 = 1
if s.find('W') != -1:
	flag2 = 1
if s.find('X') != -1:
	flag2 = 1
if s.find('Y') != -1:
	flag2 = 1
if s.find('Z') != -1:
	flag2 = 1

if flag == 1 or flag1 == 1 or flag2 == 1:
	print('WA')
else:
	print('AC')

Submission status: Accepted

Solution code:
a = list(input())
k = 0
for i in range(len(a)):
	if i == 0 and a[i] != "A":
		k = 1
		break
	elif i == 0:
		k = k
	elif i >= 2 and i <= len(a)-2:
		if a[i] == "C":
			k += 2
		elif a[i] <= "z" and a[i] >= "a":
			k = k
		else:
			k = 1
			break
	else:
		if a[i] <= "z" and a[i] >= "a":
			k = k
		else:
			k = 1
			break
if k == 2:
	print("AC")
else:
	print("WA")

Submission status: Accepted

Solution code:
#JMD
#Nagendra Jha-4096

 
import sys
import math

#import fractions
#import numpy
 
###File Operations###
fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile

###Defines...###
mod=1000000007
 
###FUF's...###
def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 
##### Main ####
s=str(input())
ans="AC"
if(s[0]!="A"):
    ans="WA"
c=0
index=-1
for i in  range(2,len(s)-1):
    if(s[i]=="C"):
        c+=1
        index=i
if(c!=1):
    ans="WA"

for i in range(len(s)):
    if(ord(s[i])<ord('a')):
        #print(ord(s[i]),ord('a'))
        if(i!=0 and i !=index):
            ans="WA"
print(ans)

    
    
#####File Operations#####
if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
Ss = input()

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

Submission status: Accepted

Solution code:
s = list(input())
cnt_c = 0

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

if s[0] == "A":
    s.remove("A")
    if cnt_c > 0:
        s.remove("C")
    if cnt_c == 1 and str(s).islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
import sys
S = input()
if S[0] == 'A' and S[2:-1].count('C') == 1:
    S = list(S)
    S.remove('A')
    S.remove('C')
    S = ''.join(S)
    if S == S.lower():
        print('AC')
        sys.exit(0)
print('WA')

Submission status: Accepted

Solution code:
S = input()
ans = cond1 = cond2 = cond3 = cond4 = True
if S[0] != "A":
    cond1 = False
T = [S[i] for i in range(len(S)) if i>=2 and i<=len(S)-2]
U = [S[i] for i in range(len(S)) if i!=0]

count = 0
index = -1
for i in range(len(T)):
    if T[i] == "C":
        count+=1
        index = i
    else:
        if not T[i].islower():
            cond3 = False
cond2 = count == 1
for i in range(len(S)):
    if i==1 or i==len(S)-1:
        if not S[i].islower():
            cond4 = False
    

ans = cond1 and cond2 and cond3 and cond4
#print((cond1,cond2,cond3,cond4))
if ans:
    print("AC")
else:
    print("WA")

Submission status: Accepted

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

S = input()

if S[0] == "A" and S[2:-1].count("C") == 1:
    S = list(S)
    for i in range(len(S)):
        if not S[i].islower() and S[i] != "A" and S[i] != "C":
            print("WA")
            exit()
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
from collections import Counter
import sys

s = input()
counter = Counter(s[2:-1])

if s[0] == 'A':
    s = s.lstrip('A')
else:
    print('WA')
    sys.exit(0)

if counter['C'] == 1:
    s = s.replace('C', '')
else:
    print('WA')
    sys.exit(0)

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

Submission status: Accepted

Solution code:
S = list(input())
flag = True
flag_t = False

if S[0] == "A":

    S_part = S[2:-1]
    # print(S_part)

    count = 0
    for i, str in enumerate(S_part):
        if str == "C":
            ind = i
            # print(i)
            count += 1

    if count == 1:
        # print(S)
        S.pop(0)
        S.pop(ind + 1)
        # print(S)

        for str in S:
            if not str.islower():
                flag = False

        if flag:
            print("AC")
            flag_t = True

if flag_t == False:
    print("WA")

Submission status: Accepted

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


S=input()
x=0
count=0

if S[0]!="A":
    print("WA")
    exit()
elif len(S)==4:
    if S[2]!="C":
        print("WA")
        exit()
    elif S[1].islower() and S[3].islower():
        print("AC")
        exit()
    else:
        print("WA")
        exit()
else:
    for i in range(2,len(S)-1):
        if S[i]=="C":
            count+=1
            x=i
    
    if count!=1:
        print("WA")
        exit()
    elif count==1:
        for i in range(1,len(S)):
            if x!=i:
                if S[i].isupper():
                    print("WA")
                    exit()
        print("AC")
        exit()

Submission status: Accepted

Solution code:
S = list(input())
N = 0
num = 0
answer = False

if S[0] == 'A':
    del S[0]
    for i in range(1, len(S)-1):
        if S[i] == 'C':
            num += 1
            N = i
    if num == 1:
        del S[N]
        SS = ''.join(S)
        answer = SS.islower()
        
if answer == True:
    print('AC')
elif answer == False:
    print('WA')

Submission status: Accepted

Solution code:
S = input()
flag = 'WA'
if S[0] == 'A':
    ss = S[1]
    s = S[2:]
    cnt_c = 0
    for i in range(len(s)-1):
        m = s[i]
        if m == 'C':
            cnt_c += 1
            #print(s[i])
            m = 'c'
        ss += m
    ss += s[-1:]
    #print(ss)
    if cnt_c == 1 and ss.islower():
        flag = 'AC'

print(flag)

Submission status: Accepted

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

    c = 0
    for i in range(len(s)):
        if i == 0:
            if s[i] != 'A':
                print('WA')
                return
        elif i == 1 and not s[i].islower():
            print('WA')
            return
        elif 2 <= i and i <= len(s) - 2:
            if s[i] == 'C':
                c += 1
            else:
                if not s[i].islower():
                    print('WA')
                    return
        else:
            if not s[i].islower():
                print('WA')
                return
        
    if c != 1:
        print('WA')
        return
        
    print('AC')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()

yes = S[0] == 'A' and \
      1 == sum(1 for c in S[2:-1] if c == 'C') and \
      2 == sum(1 for c in S if 'A' <= c <= 'Z')
print('AC' if yes else 'WA')

Submission status: Accepted

Solution code:
s = list(input())
if s[0]=="A":
  s[0] = "a"
  flag = False
  for i, ele in enumerate(s[2:-1], 2):
    if ele == "C":
      s[i] = "c"
      flag = True
      break
  if flag and str(s).islower():
    print("AC")
  else:
    print("WA")
else:
  print("WA")

Submission status: Accepted

Solution code:
S=input()

endflag=0
count=0
for num,i in enumerate(S):
    if num==0:
        if S[0]!="A":
            print("WA")
            endflag=1
    elif i=="C":
        if num<2 or num>=(len(S)-1) or count>0:
            print("WA")
            endflag=1
        else:
            count+=1
    elif i.islower() == False:
        print("WA")
        endflag=1

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

Submission status: Accepted

Solution code:
s = input()
c = 0
for i in range(len(s)):
    if s[i].isupper() == True:
        c += 1
if s[0] != "A":
    print("WA")
    exit()
if s[2:-1].count("C") != 1:
    print("WA")
    exit()
if  c != 2:
    print("WA")
    exit()
print("AC")

Submission status: Accepted

Solution code:
S = input()
lcnt = 0
for i in range(len(S)):
    if "A" <= S[i] and S[i] <= "Z":
        lcnt += 1
ccnt = 0
for i in range(2, len(S) - 1):
    if S[i] == "C":
        ccnt += 1
if S[0] != "A":
    print("WA")
elif ccnt != 1:
    print("WA")
elif lcnt != 2:
    print("WA")
else:
    print("AC")

Submission status: Accepted

Solution code:
S=input()
if S[0] != 'A' or S[1] <= 'Z' or S[-1] <= 'Z':
  print('WA')
  quit()
n = 0
for i in range(2, len(S)-1):
  if S[i] > 'Z':
    pass
  elif S[i] == 'C':
    n += 1
  else:
    n =2
if n != 1:
  print('WA')
else:
  print('AC')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())

def judge(s):
    if s[0] != 'A': return 'WA'
    elif s[2:-1].count('C') != 1: return 'WA'
    del s[s[2:-1].index('C')+2]
    del s[0]
    s=''.join(s)
    if s.lower()==s: return 'AC'
    else: return 'WA'
        
print(judge(s))

Submission status: Accepted

Solution code:
s=list(input())
ans='AC'
a=['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']
if s[0]=='A' and s[2:-1].count('C')==1 and s[1]!='C' and s[-1]!='C':
    s.remove('C')
    del s[0]
    for i in range(len(s)):
        if s[i] not in a:
            ans='WA'
            break
else:
    ans='WA'
print(ans)

Submission status: Accepted

Solution code:
def has_capital_c(string):
    #print(string[2:-2].find('C') != -1)
    #print( string[2:-2].count('C') == 1)
    if string[2:-1].find('C') != -1 and string[2:-1].count('C') == 1:
        return True
    else:
        return False

def is_lower_case_except_a_c(string):
    return string.replace('A','').replace('C','').islower()

S = input()
# print(S[0]=='A')
# print(has_capital_c(S))
# print(is_lower_case_except_a_c(S))
if S[0]=='A' and has_capital_c(S) and is_lower_case_except_a_c(S):
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = input()
flag = (S[0] == "A")
flag = flag and (S[2:-1].count("C") == 1)
if flag:
    s = S[1:]
    i = s.index("C")
    s = s[:i] + s[i+1:]
    flag = flag and (s == s.lower())
if flag:
    print("AC")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

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

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

    for s in [s for s in S if s != 'A' and s!= 'C']:
        if s.isupper():
            return 'WA'
    
    return 'AC'

print(func(S))

Submission status: Accepted

Solution code:
S = list(input())

flag = 0
flag2 = 0

for i in range(len(S)):
  if i == 0:
    if S[i] != "A":
      print("WA")
      flag2 = 1
      break
  elif i == 1:
    if ord(S[i]) >= 65 and ord(S[i]) <= 90:
      print("WA")
      flag2 = 1
      break
  elif i >= 2 and i <= len(S) - 2:
    if ord(S[i]) >= 65 and ord(S[i]) <= 90:
      if flag == 0:
        if S[i] == "C":
          flag = 1
        else:
          print("WA")
          flag2 = 1
          break
      else:
        print("WA")
        flag2 = 1
        break
  else:
      if ord(S[i]) >= 65 and ord(S[i]) <= 90:
        print("WA")
        flag2 = 1
        break

if flag == 1 and flag2 == 0:
  print("AC")
elif flag == 0 and flag2 == 0 :
  print("WA")

Submission status: Accepted

Solution code:
s = input()
t = s[2:-1]
count = 0
q = [s[1]]
for i in range(len(t)):
    if t[i] == "C":
        count += 1
    else:
        q.append(t[i])
q.append(s[-1])
q =''.join(q)
if s[0] == "A" and count == 1 and str(q).lower() ==str(q):
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()

def check(s):
  if s[0] != 'A':
    print('WA')
    return
  
  if s[2:-1].count('C') != 1:
    print('WA')
    return
  
  s = s.strip('A')
  s = list(s)
  s.remove('C')
  s = ''.join(s)
  
  if s.islower() != True:
    print('WA')
    return
  
  print('AC')

check(s)

Submission status: Accepted

Solution code:
S = input()

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

print('WA')

Submission status: Accepted

Solution code:
s = input()
s1 = ''
judge = False
if s[0] == 'A':
    for i in range(1,len(s)):
        s1 += s[i]
    jc = 0
    for i in range(1, len(s1)-1):
        if s1[i] == 'C':
            jc += 1
            s2 = ''
            for j in range(len(s1)):
                if j != i:
                    s2 += s1[j]
    if jc == 1:
        judge = True
    if judge:
        if s2.islower():
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = list(input())
count = 0
pop = 0
AC = 0
    
for i in range(2,len(S)-1):
    if S[i] == 'C':
        count = count + 1
        pop = i
    
if S[0] == 'A':
    if count == 1:
        S[0] = 'a'
        S[pop] = 'c'
        m = ''.join(S)
        if str.islower(m):
            print('AC')
            AC = 1
            
            
if AC != 1:
    print('WA')

Submission status: Accepted

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


def solve(strings):
    if strings[0] != "A":
        return 'WA'

    count = 0
    for i in range(2, len(strings)-1):
        if strings[i] == 'C':
            count += 1
    if count != 1:
        return 'WA'

    for s in strings:
        if s != 'A' and s != 'C':
            if s.isupper():
                return 'WA'

    return 'AC'


print(solve(S))

Submission status: Accepted

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

S = input()

wa = 0

if S[0] == "A":
    pass
else:
    wa = 1

n = 0
for i in S[2:-1]:
    if i == "C":
        n = n + 1
if n == 1:
    pass
else:
    wa = 1 


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

if n == 2:
    pass
else:
    wa = 1        

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

Submission status: Accepted

Solution code:
s = input()

ccount = 0;
i = 0

for c in s:
    if i == 0:
        if c != "A":
            print("WA")
            exit()
    elif 2 <= i and i <= len(s) - 2 and c == "C":
        if ccount >= 1:
            print("WA")
            exit()
        ccount = ccount + 1
    else:
        if c.isupper():
            print("WA")
            exit()
    i += 1

print("AC" if ccount == 1 else "WA")

Submission status: Accepted

Solution code:
S = input()
SL = [x for x in S]

ok = S[0] == "A"
SL[0] = "a"

ok = ok and (S[2:-1].count("C") == 1)
cpos = S[2:-1].find("C")

if cpos != -1:
    SL[2+cpos] = "c"

for c in SL:
    ok = ok and not c.isupper()

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

Submission status: Accepted

Solution code:
import numpy as np

l = list(input())
l = np.array(l)


state = 'AC'

if l[0] != 'A':
    state = 'WA'
else:
    l[0] = 'a'
    l2 = l[2:-1].copy()
    Cplace = np.where(l2=='C')[0]

    if len(Cplace) == 1:
        l2[Cplace[0]] = 'c'
        l[2:-1] = l2
        arr = ''.join(l)
        if not arr.islower():
            state = 'WA'

    else:
        state = 'WA'

print(state)

Submission status: Accepted

Solution code:
import sys

s = input()

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


count = 0
pos = None
for i in range(2, len(s)-1):
    if s[i] == 'C':
        pos = i
        count += 1

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

for i in range(1, len(s)):
    if i != pos and s[i].isupper():
        print('WA')
        sys.exit(0)

print('AC')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
ans = True
if S[0]!='A':
    ans = False
    print("WA")
else:
    S = S.replace('A', '')

if ans:
    tmp = False
    for c in S[1:-1]:
        if c=='C':
            if not tmp:
                tmp = True
            else:
                ans = False
                print("WA")
                break
    if not tmp:
        ans = False
        print("WA")

if ans:
    S = S.replace('C', '')

if ans:
    tmp = True
    for c in S:
        if not (ord(c)>=97 and ord(c)<123):
            tmp = False
    if not tmp:
        print("WA")
        ans = False

if ans:
    print("AC")

Submission status: Accepted

Solution code:
import re
import sys

def check_upper_char(string):
    result = re.search('[A-Z]', string)
    return True if result else False

def in_onec(s):
    cnt = 0
    for i in range(len(s)):
        if s[i] == 'C':
            cnt += 1

    if cnt == 1:
        return True
    else:
        return False

s = input()

sub_s = s[2:-1]

if (s[0] == 'A') and in_onec(sub_s):
    s = s.replace('A', '')
    s = s.replace('C', '')
    if not check_upper_char(s):
        print('AC')
        sys.exit()
print('WA')

Submission status: Accepted

Solution code:
s = input()
count = 0

for i in s:
    if ord("A") <= ord(i) <= ord("Z"):
        count += 1
else:
    if s.count("C") == 0:
        print("WA")
        exit()
    if s[0] == "A" and 2 <= s.index("C") <= len(s)-2 and count == 2:
        print("AC")
    else:
        print("WA")

Submission status: Accepted

Solution code:
a=input()
flag=0
if a[0]=='A':
    i=1
    c=0
    while i<len(a):
        if i>=2 and i<=len(a)-2 and a[i]=='C' and c==0:
            i+=1
            c=1
        elif ord(a[i])>=97 and ord(a[i])<=122 and a[i]!='C':
            i+=1
        else:
            flag=1
            break
    if flag==0 and c!=0:
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
flag = 0
s = input()

a = s[0:2]
b = s[2:-1]
c = s[-1:]





if a[0] == 'A':
    if b.count('C') == 1:
        a = a.replace('A', '', 1)
        b = b.replace('C', '', 1)
        s = a+b+c
        if s.islower() == True:
            flag = 1

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

Submission status: Accepted

Solution code:
s = input()
a = 1
b = 0
c = 0
if s[0] == "A":
    a = a * 1
else:
    a = a * 0
if s[1] != "C":
    for i in range(2, len(s) - 1):
        if s[i] == "C":
            b = b + 1
            if c == 0:
                c = i
    if b == 1:
        a = a * 1
    else:
        a = a * 0
else:
    a = a * 0

ss = s[1:c] + s[c + 1:len(s) + 1]
#print(ss)
if ss.islower():
    a = a * 1
else:
    a = a * 0

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

Submission status: Accepted

Solution code:
import re

S = input()


if re.match(r"^A[a-z]+C[a-z]+$", S):
	print("AC")
else:
	print("WA")

Submission status: Accepted

Solution code:
a = str(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

        S0.remove('A')
        S0.remove('C')

        S3=''.join(S0)
        S3=S3.lower()
        S3=list(S3)
        if S3==S0:
            is_ans=1
print("AC" if is_ans else "WA")

Submission status: Accepted

Solution code:
x = input()
ans = 0
if x[0] == "A":
    if "C" in x[2:len(x)-1]:
        x=x.replace("A","",1)
        x=x.replace("C","",1)
        if x.islower():
            ans = 1

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

Submission status: Accepted

Solution code:

S = input()

result = 'WA'
if S[0] == 'A':
    if S[2:-1].count('C') == 1:
        if len([x for x in S if x.islower()]) == len(S) -2:
            result = 'AC'


print(result)

Submission status: Accepted

Solution code:
#!/bin/python
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')
    exit()

print('WA')
exit()

Submission status: Accepted

Solution code:
S = str(input())

if S[0] != "A":
    print("WA")
else:
    if len(S) == 4:
        if S[2] == "C" and S[3].islower() and S[1].islower():
            print("AC")
        elif S[3] == "C" and S[2].islower() and S[1].islower():
            print("AC")
        else:
            print("WA")
    else:
        s = S[2:-1]
        if "C" not in s:
            print("WA")
        else:
            counter = 0
            for i in S[1:]:
                if i.isupper():
                    counter += 1
            if counter == 1:
                print("AC")
            else:
                print("WA")