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 getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

def check01(s):

    if s[0]!="A":

        return False

    if s[2:-1].count("C")!=1:
    
        return False
    
    posi=s[2:-1].find("C",0)+2
    
    if any(s[i].isupper() for i in range(len(s)) if i!=0 and i!=posi):

        return False
    
    return True
    

arr_data = getinputdata()

s=arr_data[0][0]

print("AC" if check01(s) else "WA")

Submission status: Accepted

Solution code:
str=list(input())

count1=0
count2=0
if str[0]=="A":
  for i in range(len(str)-3):
    if str[i+2]=="C":
      count1 += 1
  for i in range(len(str)):
    if str[i]==str[i].capitalize():
      count2 += 1
  if count1 == 1 and count2 ==2 :
    print("AC")
  else:
    print("WA")
else:
  print("WA")

Submission status: Accepted

Solution code:
s = input()
ans = "WA"
if s[0]=="A":
  if s[2:len(s)-1].count("C")==1:
    x = s.find("C")
    s2 = "a"+s[1:x]+"c"+s[x+1:]
    if s2==s.lower(): ans = "AC"
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math,string,itertools,fractions,heapq,collections,re,array,bisect
def s():
    return input()

S = s()
count = 0
abc = 'abcdefghijklmnopqrstuvwxyz'
if S[0] == 'A':
    if S[1] in abc:
        for i in range(1,len(S)-1):
            if S[i] in abc:
                continue
            elif S[i] == 'C':
                count += 1
            else:
                print('WA')
                exit()
        if S[-1] in abc and count == 1:
            print('AC')
            exit()

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')

Submission status: Accepted

Solution code:
from string import ascii_lowercase


def solve(s):
    if s[0] != 'A':
        return False
    ci = s.find('C')
    if not 2 <= ci <= len(s) - 2:
        return False
    exclude = [0, ci]
    for i, c in enumerate(s):
        if i in exclude:
            continue
        if c not in ascii_lowercase:
            return False
    return True


s = input()
print('AC' if solve(s) else 'WA')

Submission status: Accepted

Solution code:

s = input()
A = False
C = False
X = 0
if(s[0] == 'A'):
    A = True
for c in s[2:-1]:
    if(c == 'C'):
        C = True
for c in s:
    if(c.isupper()):
        X += 1
if(A and C and X == 2):
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
import re

s = input()

if not s.startswith('A'):
    print('WA')
elif s[2:len(s) - 1].count('C') != 1:
    print('WA')
elif len(re.findall('[A-Z]', s)) != 2:
    print('WA')
else:
    print('AC')

Submission status: Accepted

Solution code:
S=str(input())
if S[0]=='A':
    S=S[1:]
else:
    print('WA')
    exit()

S_part=S[1:-1]
if S_part.count('C') != 1:
    print('WA')
    exit()
else:
    S_part = S_part.replace('C','')
    S_part = S[0]+ S_part + S[-1]

    for i in range(len(S_part)):
        if S_part[i] >='A' and S_part[i]<='Z':
            print('WA')
            exit()
    else:
        print('AC')

Submission status: Accepted

Solution code:
import re

s = list(input())

def error_out():
    print('WA')
    exit()

if s[0] != 'A':
    error_out()
else:
    s[0] = 'a'

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

if count != 1:
    error_out()

if re.search('[A-Z]', ''.join(s)):
    print('WA')
else:
    print('AC')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s=input()
f=True
if s[0]=="A":
  if s[2:-1].count("C")==1:
    if "".join(s[1:].split("C")).islower():
      print("AC")
      f=False
if f:
  print("WA")

Submission status: Accepted

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


def main():
    s = input()
    c_count = 0
    s0 = s[0]

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

    s = s.replace('A', '', 1)
    s = s.replace('C', '', 1)
    result = s.islower()

    if s0 == 'A' and c_count == 1 and result is True:
        print('AC')
    else:
        print('WA')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8


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

    s = s[1:]
    s = s.replace('C', '', 1)
    if s.islower() == False:
        print("WA")
        return

    print("AC")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(10000000)

S = raw_input()

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

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

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

Submission status: Accepted

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

in_data = input()

if None != re.fullmatch('A[a-z]+C[a-z]+', in_data):
	print('AC')
else:
	print('WA')

Submission status: Accepted

Solution code:
s = input()
small = list("abcdefghijklmnopqrstuvwxyz")


if s[0] == "A" and s[2:-1].count("C") == 1:
	i = s.index("C")
	for j in range(1, len(s)):
		if j == i:
			continue
		else:
			if s[j] not in small:
				print("WA")
				break
	else:
		print("AC")
else:
	print("WA")

Submission status: Accepted

Solution code:
#atcoder104b
import re

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

Submission status: Accepted

Solution code:
s=list(input())
a,c=s[0]=='A',0
for i in range(1,len(s)):
	if s[i]<'a'or'z'<s[i]:
		if c or s[i]!='C' or i in[1,len(s)-1]:
			a=0
			break
		else:
			c=1
print("AC"if a and c else"WA")

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = input()

ans = 'AC'

if not (S[0] == 'A' and S[2:-1].count('C') == 1):
    ans = 'WA'
for s in S:
    if (not (s == 'A' or s == 'C')) and not s.islower():
        ans = 'WA'

print(ans)

Submission status: Accepted

Solution code:
s = str(input())
a_cnt=0
c_cnt=0
l_cnt=0
s_up=s.upper()
if s[0] == 'A':
    a_cnt += 1
for i in range(2,len(s)-1):
    if s[i] == 'C':
        c_cnt += 1

for i in range(len(s)):
    if s_up[i] == s[i]:
        l_cnt += 1

if a_cnt == 1 and c_cnt == 1 and l_cnt == 2:
    print("AC")
else:
    print("WA")

Submission status: Accepted

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

if s[0] == 'A':
  if s[2:l - 1].count('C') == 1:
    idx = s[2:l - 1].index('C') + 2
    if s[1:idx].islower() and s[idx + 1:].islower():
      print('AC')
      quit()
print('WA')

Submission status: Accepted

Solution code:
S = input()

if S[0] == "A" and S[2:-1].count("C") == 1:
    count = 0
    for i in range(len(S)):
        if S[i].islower():
            count += 1

    if count == len(S) - 2:
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
S=input();print('WAAC'['C'in S[2:-1]*S[1:].replace('C','','A'in S).islower()::2])

Submission status: Accepted

Solution code:
S=input();print('WAAC'[('C'in S[2:-1])*S[1:].replace('C','','A'in S).islower()::2])

Submission status: Accepted

Solution code:
S=input();print('WAAC'[('C'in S[2:-1])*(S[1:].replace('C','','A'in S).islower())::2])

Submission status: Accepted

Solution code:
S=input();print('WAAC'[('C'in S[2:-1])*('A'in S)*(S[1:].replace('C','',1).islower())::2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
s = S[2:-1]
if S[0] != 'A':
    print('WA')
    exit()
flag = 0
for i in s:
    if i == 'C':
        flag += 1
if flag != 1:
    print('WA')
    exit()
l = list(S[1:])
l.remove('C')
l = ''.join(l)
if l != l.lower():
    print('WA')
    exit()
print('AC')

Submission status: Accepted

Solution code:


def solve(s):
    # 'AC' か 'WA' を返す

    # Sの先頭の文字は大文字の A である。
    if s[0] != 'A':
        return 'WA'

    # Sの先頭から3文字目と末尾から
    # 2文字目の間（両端含む）に大文字の C
    # がちょうど  1  個含まれる。
    if len([True for c in s[2:-1] if c == 'C']) != 1:
        return 'WA'

    # 以上の A, C を除くSのすべての文字は小文字である。
    n_diff = 0
    for s_ in s:
        sl_ = s_.lower()
        if s_ != sl_:
            n_diff += 1

    if n_diff != 2:
        return 'WA'

    return 'AC'


s = input()
print(solve(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re


def solve(s):
    # 'AC' か 'WA' を返す

    # Sの先頭の文字は大文字の A である。
    if s[0] != 'A':
        return 'WA'

    # Sの先頭から3文字目と末尾から
    # 2文字目の間（両端含む）に大文字の C
    # がちょうど  1  個含まれる。
    s_ = s[2:-1]
    if len([True for c in s_ if c == 'C']) != 1:
        return 'WA'

    # 以上の A, C を除くSのすべての文字は小文字である。
    n_capital = len(re.findall('[A-Z]', s))
    if (n_capital - 2) != 0:
        return 'WA'

    return 'AC'


s = input()
print(solve(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def check(s):
    if (s[0] != 'A'): return False
    
    c = 0
    for i in range(2, len(s) - 1):
        if (s[i] == 'C'):
            c += 1
    if c != 1: return False

    upper = 0
    for i in range(len(s)):
        if ('A' <= s[i] <= 'Z'):
            upper += 1
    if upper != 2: return False
    return True

S = input()
print('AC' if check(S) else 'WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
S=input()
N=len(S)
#L=['B','D','E','F','G','H','I','J','K','L','N','M','O','P','Q','R','S','T','U','V','W','X','Y','Z']
if S[0]!='A':
    print('WA')
    sys.exit()
ans=0
for i in range(2,N-1) :
    if S[i]=='C':
        ans+=1
if ans!=1:
    print('WA')
    sys.exit()
num=0
for i in range(N) :
    if S[i]>='A' and S[i]<='Z':
        num+=1
if num!=2:
    print('WA')
    sys.exit()
print('AC')

Submission status: Accepted

Solution code:
import sys
S=input()
N=len(S)
#L=['B','D','E','F','G','H','I','J','K','L','N','M','O','P','Q','R','S','T','U','V','W','X','Y','Z']
if S[0]!='A':
    print('WA')
    sys.exit()
ans=0
for i in range(2,N-1) :
    if S[i]=='C':
        ans+=1
if ans!=1:
    print('WA')
    sys.exit()
for i in range(N) :
    if S[i] in 'AC':
        continue
    if S[i].isupper():
        print('WA')
        sys.exit()
print('AC')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=list(input())
flag=0
Ccount=0
Cnumber=0
if S[0]=="A":
  flag+=1
if S[2:-1].count("C")==1:
  flag+=1
  del S[0]
  S.remove("C")
if str(S).islower():
  flag+=1
if flag==3:
  print("AC")
else:
  print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
s = input()
pattern = r'^A[a-z][a-z]*C{1}[a-z]*[a-z]$'

if re.match(pattern, s):
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
S = input()
ac=0
if S[0]=="A" and S.count("A")==1 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")
        ac=1
if ac == 0 :
    print("WA")

Submission status: Accepted

Solution code:
import sys
import socket
from collections import Counter

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('b1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    s = read_str()
    res = 'WA'
    if s[0] == 'A':
        c = 0
        for letter in s[2:-1]:
            if letter == 'C':
                c += 1
        if c == 1:
            upper = 0
            for letter in s:
                if letter.lower() != letter:
                    upper += 1
            if upper == 2:
                res = 'AC'
    print(res)


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

if S[2:-1].count('C') != 1:
  print('WA')
else:
    if S[0] != 'A':
      print('WA')
    else:
        S = list(map(lambda x: x, S))
        S[0] = 'a'
        S[S[2:-1].index('C')+2] = 'c'
        if ''.join(S).islower():
          print('AC')
        else:
          print('WA')

Submission status: Accepted

Solution code:
def test():
    s = str(input())
    l = len(s)
    if s[0] == "A":
        s_1 = s[1:]
        # print(s_1)
        for i in range(1,l-2):
            if s_1[i] == "C":
                # print(i)
                s_2 = s_1[:i] + s_1[i+1:]
                # print(s_2)
                if s_2.islower():
                    print("AC")
                    return 0
    print("WA")
    return 0

test()

Submission status: Accepted

Solution code:
# Sの先頭の文字は大文字のAである。
# Sの先頭から3文字目と末尾から2文字目の間（両端含む）に大文字のCがちょうど1個含まれる。
# 以上のA, Cを除くSのすべての文字は小文字である。

x = input()


def b_mon(S):
    if not S[0] == 'A':
        return 'WA'
    if not S[2:-1].count('C') == 1:
        return 'WA'

    c_index = S[2:-1].find('C') + 2
    S = S[1:c_index] + S[c_index + 1:]
    if False in list(map(lambda char: char.islower(), S)):
        return 'WA'

    return 'AC'

print(b_mon(x))

Submission status: Accepted

Solution code:
s=list(input())
ans='WA'
if s.pop(0) == 'A':
    for i in range(1,len(s)-1):
        if s[i] == 'C':
            s.pop(i)
            if "".join(s).islower():
                ans='AC'
                break
            break
print(ans)

Submission status: Accepted

Solution code:
def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
s=input()
ss="AC"
if s[0]=="A" and s[2:-1].count("C")==1:
   for i in range(len(s)):
     if s[i]=="A" or s[i]=="C" or ord(s[i])>ord("Z"):    
       continue
     ss="WA" 
else:
     ss="WA"
print(ss)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S=input()

cc=0
nc=0
for i in range(2,len(S)-1):
    if S[i]=='C' and S[i].islower()==False:
        cc+=1
        nc=i

if cc==1 and not nc==0:
    p1=True
else:
    p1=False

if S[0]=='A' and S[0].islower()==False:
    p2=True
else:
    p2=False

bc=0
for i in range(len(S)):
    if i==0 or i==nc:
        pass
    else:
        if S[i].islower()==False:
            bc+=1

if p1==True and p2==True and bc==0:
    print('AC')

else:
    print('WA')

Submission status: Accepted

Solution code:
S=raw_input();l=len(S);f=S.find('C');A=0
if S[:1]=='A':
	A+=1
	S="a"+S[1:]
if S[2:l-1].count('C')==1:
	A+=1
	S=S[:f]+'c'+S[f+1:]
if S.islower():
	A+=1
print('AC'if A==3 else'WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def judge(string):
    cw = False
    judge = False
    for i in range(2, len(string) - 1):
        if string[i].isupper() and string[i] != 'C':
            judge = True
        elif string[i].isupper() and string[i] == 'C' and cw:
            judge = True
        
        if string[i] == 'C':
            cw = True

    if judge or cw == False:
        return True
    else:
        return False        
    
if __name__ == "__main__":
    s = list(input().strip())
    if s[0] != "A" or s[1].isupper() or s[-1].isupper() or judge(s):
        print('WA')
    else:
        print('AC')

Submission status: Accepted

Solution code:
import re

s = input()


if re.match(r'A[a-z]+C[a-z]+\Z',s) == None:
  print("WA")
else:
  print("AC")

Submission status: Accepted

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

if S[0] != 'A':
    print('WA')
elif 'C' not in S[2:-1]:
    print('WA')
else:
    i = S[2:-1].find('C')
    S = S[1:2 + i] + S[2 + i + 1:]
    if not S.islower():
        print('WA')
    else:
        print('AC')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S_pro = input()
S = list(S_pro)
loc_A = 0
loc_C = 0
flag = 0
flag_c = 0

if(S[0] == 'A'):
    flag+=1
    loc_A = 0
for i in range(len(S)):
    if(i >= 2 and i <= len(S)-2):
        if(S[i] == 'C'):
            flag_c+=1
            loc_C = i
if(flag_c==1):
    flag+=1

del S[loc_A]
del S[loc_C-1]

S_join = ''.join(S)
if(S_join.islower()):
    flag+=1
if(flag == 3):
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1 and sum(_==_.upper() for _ in s)==2:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = input()
judge = False
if S[0] == "A":
    if list(S[2:len(S)-1]).count("C") == 1:
        S = S.lstrip("A")
        S = S.replace("C", "")
        if S.islower():
            judge =True
if judge:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
input_line = input()

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

if input_line.count('A') == 1 and input_line.count('C') == 1:
    must_lower = input_line.replace('A', '').replace('C', '')
    if must_lower.islower():
        print("AC")
        exit()

print("WA")
exit()

Submission status: Accepted

Solution code:
# B.py
S = input()
if S[0] != "A":
	print("WA")
	exit()
i = 2
s = 0
j = 0
while i < len(S)-1:
	if S[i] == "C":
		s = s + 1
		j = i
	i += 1

if s != 1:
	print("WA")
	exit()

i = 1
while i < len(S):
	if i != j and S[i].isupper():
		print("WA")
		exit()
	i += 1

print("AC")

Submission status: Accepted

Solution code:
S = input()
     
a = S.find('A')
c = S.find('C')
     
s1 = S[2:-1]
s_count = s1.count('C')
   
y = S[1:c-1]
z = S[c+1:]

if c == 2:
	y = S[1]   

if a != 0:
	print('WA')

elif s_count != 1:
	print('WA')
     
else:
	if y.islower() and z.islower():
			print('AC')
	else:
		print('WA')

Submission status: Accepted

Solution code:
# cook your dish here
s=list(input())
c = 0
if s[0] == 'A':
    c += 1
if s[2:len(s)-1:].count('C') == 1:
    c += 1

    s.remove('C')
if 'A' in s:
    s.remove('A')
a = 'a'
for i in range(len(s)):
    a += s[i]
if a.islower():
    c += 1
 
if c == 3:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
str = input()
len = len(str)
a_flg = False
c_cnt = 0
wa_flg = False

for i, s in enumerate(str):
    if i == 0 and s == 'A':
        a_flg = True
    elif 2 <= i <= len-2 and s == 'C':
        if c_cnt < 1:
            c_cnt += 1
        else:
            wa_flg = True
            break
    elif 'A' <= s <= 'Z':
        wa_flg = True
        break

if a_flg and c_cnt == 1 and not wa_flg:
    print('AC')
else:
    print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
words = input()
if words.startswith('A') and words.find('C') >= 2 and not words.endswith("C") and words.count('C') == 1:
    w1 = words.strip("A")
    w2 = w1.replace("C","c")
    if w2.islower():
        print('AC')
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
def check_string(s):
  if(a_exist(s)):
    c_index = c_find(s)
    if(c_index != False):
      if(is_lower(s,c_index)):
        return 'AC'
  return 'WA'

def a_exist(s):
  if(s[0] == 'A'):
    return True
  else:
    return False

def c_find(s):
  c_cnt = 0
  for i in range(len(s)):
    if(i < 2):
      continue
    if(i == len(s)-1):
      continue
    if(s[i] == 'C'):
      c_cnt += 1
      index = i
  if(c_cnt == 1):
    return index
  else:
    return False

def is_lower(s,index):
  for i in range(len(s)):
    if(i == 0):
      continue
    if(i == index):
      continue
    if(s[i].islower() == False):
      return False
  return True

if __name__ == '__main__':
  s = input()
  print(check_string(s))

Submission status: Accepted

Solution code:
s = input()
counter = 0
Ccounter = 0
Bigcounter = 0
while len(s)-4 >= counter:
    if s[counter+2] == "C":
        Ccounter += 1
    counter += 1
counter = 0
while len(s)-1 >= counter:
    if s[counter].islower() == False:
        Bigcounter += 1
    counter += 1
if s[0]=="A" and Ccounter == 1 and Bigcounter == 2:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
import sys
S = input()
if S[0:1] != "A":
    print("WA")
    sys.exit()
s2 = S[2:]
s2 = s2[:-1]
if s2.count("C") != 1:
    print("WA")
    sys.exit()
s3 = S.replace("A", "")
s3 = s3.replace("C", "")
s4 = s3.lower()
if (s3 != s4):
    print("WA")
else:
    print("AC")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
s = raw_input()
lens=len(s)
lenso=lens-1
a=0
if s[0]=="A":
    if ord(s[1])>=0x5B:
            if ord(s[lenso])>=0x5B:
                if s.find("C")>=0:
                    for i in range(2,lens):
                        if ord(s[i])<=0x5B:
                            a=a+1
                    if a==1:
                        print"AC"
                    else:
                        print"WA"
                else:
                    print"WA"
            else:
                print"WA"
    else:
        print"WA"
else:
    print"WA"

Submission status: Accepted

Solution code:
s=list(input())
sl=len(s)
c_cnt=0
for i in range(2,sl-1):
    if s[i]=="C":
        c_cnt+=1
if s[0]=="A":
    if c_cnt==1:
        s.remove("A")
        s.remove("C")
        temp="".join(s)
        if temp.islower():
            print("AC")
            exit()
print("WA")

Submission status: Accepted

Solution code:
S = list(input())

if S[0] == "A":
    if S[2:-1].count("C") == 1:
        idx = S.index("C")
        for i, s in enumerate(S):
            if s.isupper():
                if (i == 0) or (i == idx):
                    continue
                else:
                    print("WA")
                    exit()
        print("AC")
        exit()
print("WA")

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
from collections import Counter
def capital(c):
  return c in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

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

  if capital(s[1]) or capital(s[-1]):
    return False

  st = Counter(s[2:-1])
  if st['C'] != 1:
    return False
  for c in s[2:-1]:
    if c == 'C': continue
    if capital(c): return False
  return True

s=raw_input()
if solve(s):
  print 'AC'
else:
  print 'WA'

Submission status: Accepted

Solution code:
a = list(raw_input())
b = a[2:-1]
if a[0] == "A" and b.count("C") == 1:
  c = b.index("C")
  a.pop(0)
  a.pop(c+1)
  d = ""
  for i in range(len(a)):
     d += a[i] 
  if d.islower():
     print "AC"
  else:
     print "WA"
else:
  print "WA"

Submission status: Accepted

Solution code:
S = raw_input()
l=len(S)
if S[:1] == 'A':
	AC = 1
	S = "a"+S[1:]
else:
	AC = 0
if S[2:l-1].count('C')==1:
	AC2 = 1
else:
	AC2 = 0
if S.find('C')>=2:
	S = S[:S.find('C')] + 'c' + S[S.find('C')+1:]
if S.islower():
	AC3 = 1
else:
	AC3 = 0
if AC+AC2+AC3 == 3:
	print 'AC'
else:
	print 'WA'

Submission status: Accepted

Solution code:
S = input()
S_len = len(S)
import re

S_check = []
a = []
b = []
if S[0] == 'A':
    for i in range(2,S_len-1):
        if S[i] == 'C':
            S_check.append('a')
    if len(S_check) == 1:
        S_list = list(S)
        S_list[0] = str('a')
        C_loc = S.find('C')
        S_list[C_loc] = str('c')
        S = "".join(S_list)
        if S.islower() == True:
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

f1 = False
f2 = False
f3 = False

if s[0] == "A":
    f1 = True

s2 = s[2:-1:]
found = s2.find("C")
if found != -1:
    s2 = s2.replace("C", "", 1)
found2 = s2.find("C")
if found >= 0 and found2 == -1:
    f2 = True
if f1 and f2:
    s = s.replace("A", "").replace("C", "")

if s.islower():
    f3 = True
if f1 and f2 and f3:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
if __name__ == '__main__':

    S = input()

    if S[0] != "A":
        print("WA")
    elif S[2:-1].count("C") != 1:
        print("WA")
    elif S[1].islower() is not True or S[-1].islower() is not True:
        print("WA")
    else:
        print("AC")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
N=len(S)
s=S[2:-1]
s2=S[1]
sl=S[N-1]
sr=s.replace("C","c")
sf=s2+sr+sl
if S.startswith("A"):
	if s.count("C")==1:
		if sf.islower():
			print("AC")
		else:
			print("WA")	
	else:
		print("WA")
else:
	print("WA")

Submission status: Accepted

Solution code:
S = list(input())

_condi_flag = False


if S[0] == 'A':
    for i in range(2, len(S)-1):
        if S[i] == 'C':
            _condi_flag = True
            index = i
            break


if _condi_flag == True:
    S.pop(index)
    S.pop(0)
    S = str(S)
    if S.islower() == True:
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

Solution code:
import copy

def main():
    string = input()
    str_list = list(string)
    if str_list[0] == "A":
        cnt = 0
        index = 0
        for i in range(2, len(str_list)-1):
            if str_list[i] == "C":
                cnt += 1
                index = i
        if cnt == 1:
            str_list[0] = "a"
            str_list[index] = "c"
            str_changed = "".join(str_list)
            if str_changed.islower():
                print("AC")
            else:
                print("WA")
        else:
            print("WA")

    else:
        print("WA")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def solve(s):
    if s[0]!='A':
        return 'WA'
    if s[2:len(s)-1].count('C')!=1:
        return 'WA'
    s=str(s.split('A'))
    s=str(s.split('C'))
    if not s.islower():
        return 'WA'
    return 'AC'

s=input()
print(solve(s))

Submission status: Accepted

Solution code:
word = input('')

ans = 'WA'

if  (word[0] == 'A'):
    tmp = word[2:-1]
    number_c = 0
    for i in range(len(tmp)):
        if  tmp[i] == 'C':
            number_c += 1
            serial_c = i+2
    if  number_c == 1:
        word_del = word[0:serial_c] + word[serial_c+1:]
        word_del = word_del[1:]
        
        if  word_del.islower():
            ans = 'AC'
print(ans)

Submission status: Accepted

Solution code:
S = input()
if S[0] == 'A':
  s =S[2:-1]
  if s.find('C') == -1:
    print('WA')
  else:
    if s[(s.find('C')+1):].find('C') > -1:	
      print('WA')
    else:
      if S[1:(s.find('C')+2)].islower():
        if S[s.find('C')+3:].islower():
          print('AC')
        else:
          print('WA')
      else:
        print('WA')
else:
	print('WA')