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.

Solution (Python):

s = input()

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

cnt = 0
for char in s[2:-1]:
    if char=='C':
        cnt += 1
if cnt!=1:
    print ('WA')
    exit()

cnt_upper = 0
for char in s:
    cnt_upper += char.isupper()
if cnt_upper != 2:
    print ('WA')
    exit()

print ('AC')

Solution (Python):
s = input()

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

Solution (Python):
s = input()
text = s[2:-1]
r = s.replace('A', '')
r = r.replace('C', '')

if s[0] != 'A' or text.count('C') != 1 or r != r.lower():
    print('WA')
else:
	print('AC')

Solution (Python):


def judge(s):
    if s[0] != 'A':
        return False
    if s[2:-1].count('C') != 1:
        return False
    if not s[1:].replace('C', 'c').islower():
        return False
    return True

s = input()
if judge(s):
    print("AC")
else:
    print("WA")

Solution (Python):

"""
B - AcCepted
https://beta.atcoder.jp/contests/abc104/tasks/abc104_b

"""
import sys
from sys import stdin
input = stdin.readline


def solve(S):
    result = 'AC'
    if S[0] != 'A':
        result = 'WA'
    if S[2:-1].count('C') != 1:
        result = 'WA'
    S = S[1:2] + S[2:-1].replace('C', 'c') + S[-1:]
    if not S.islower():
        result = 'WA'
    return result


def main(args):
    S = input().strip()
    ans = solve(S)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Solution (Python):
"""
B - AcCepted
文字列 S が与えられます。S のそれぞれの文字は英大文字または英小文字です。 S
が次の条件すべてを満たすか判定してください。

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

s = input()

cnt_C = 0
ans = True
if s[0] != "A":
    ans = False
    
else:
    length = len(s)

    n = 1
    for check_char in s[1:]:
        
        
        if check_char.islower() is False:
            if check_char != "C" or n == 1 or n == (length - 1):
                ans = False
            
            cnt_C += 1
        
        n += 1

if cnt_C != 1:
    ans = False

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

Solution (Python):
s = input()
part_of_s = s[2:-1]
sub_s = s.replace('A','')
sub_s = sub_s.replace('C','')

if s[0] != 'A' or part_of_s.count('C') != 1 or sub_s != sub_s.lower():
    print('WA')
    exit()

print('AC')

Solution (Python):


cnt = 0
s = input()
if s[0]=="A" and "C" in s[2:-1]:
    for i in s:
        if "A" <= i <= "Z":
            cnt +=1
    if cnt == 2:
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
s = input()
flag = True

if (s[0] != 'A' or s[2:-1].count('C') != 1 or s.lower() != s.replace('A','a').replace('C','c')):
    flag = False

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

Solution (Python):
S = input()
flag = True

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

Solution (Python):
S = input()
flag = True

if (S[0] != 'A' or S[2:-1].count('C') != 1 or S.lower() != S.replace('A','a').replace('C','c')):
  flag = False
  
if flag:
  print('AC')
else:
  print('WA')

Solution (Python):
s=input()
if s[0]!='A':
    print('WA')
elif s[1].isupper():
    print('WA')
elif s[-1].isupper():
    print('WA')
else:
    C=0
    s=s[2:-1]
    for c in s:
        if c=='C':
            C+=1
            if  C>1:
                print('WA')
                break
    if C==1:
        print('AC')
    elif C==0:
        print('WA')

Solution (Python):
s = list(input())

flag =0
if s[0] !="A":
    flag =1
else:
    index=2
    count=0
    while index<len(s)-1:
        if s[index]=="C":
            count+=1
        index+=1
    if count!=1:
        flag=1
    else:
        index2=0
        count2=0
        while index2<len(s):
            if s[index2]=="A" or s[index2]=="C":
                count2+=1
            elif s[index2].islower():
                pass
            else:
                flag=1
            index2+=1
        if count2!=2:
            flag =1
    
if flag==0:
    print("AC")
else:
    print("WA")

Solution (Python):
S = input()
accept = False

if S[0] == "A" and S[2:-1].count("C") == 1:
    i =  S.index("C")
    S = S[1:i] + S[i+1:]
    if S.islower():
        accept = True

if accept:
    print("AC")

else:
    print("WA")

Solution (Python):
S = list(str(input()))
S2 = list(S)
if("A" in S2):
	S2.remove("A")
if("C" in S2):
	S2.remove("C")
s = "".join(S2)

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

Solution (Python):
S=input()
if S.find('A')==0 and len(S)-2>=S.find('C')>=2:
	S=S.replace('A','a',1)
	S=S.replace('C','c',1)
	if S.islower():
		print('AC')
	else:
		print('WA')
else:
	print('WA')

Solution (Python):
S = input()
if S[0] == 'A':
    S = 'a' + S[1:]
    if S[2:-1].count('C') == 1:
        S = S[:S.index('C')] + 'c' + S[S.index('C')+1:]
        if S.islower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
s = input()
check = 0
if s[0] == "A":
  if s[2:len(s)-1].count("C") == 1:
    if s[1].lower() == s[1] and s[len(s)-1].lower() == s[len(s)-1]:
      t = s.replace("C","")
      if t[1:len(s)].lower() == t[1:len(s)]:
        check = 1
        
if check == 0:
  print("WA")
else:
  print("AC")

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

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

Solution (Python):
s = list(input())
if s[0] == "A"\
and s[2:-1].count("C") == 1\
and [e for e in s if e.isupper()] == ["A","C"]:
  print("AC")
else:
  print("WA")

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

Solution (Python):
counter = 0
S = input()
if S[0] == "A" :
    if S.count("A") == 1 :
        if "C" in S[2:-1] :
            if S.count("C") == 1 :
                t = S.lower()
                s = S.replace("A","a").replace("C","c")
                if s == t :
                    print("AC")
                    counter += 1
if counter == 0 :
    print("WA")

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

Solution (Python):
s = list(input())

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

s_upper = [
    chara for chara in s if chara != "C" and chara != "A" and chara.isupper()
]
if len(s_upper) > 0:
    print("WA")
    exit()

print("AC")

Solution (Python):
s=list(input())
n=len(s)
s_in_not = [a for a in s[1:] if 'C' not in a]
s_not = ''.join(s_in_not)
s_not.islower()
if not s[0]=='A':
    print("WA")
elif not s[2:n-1].count("C")==1:
    print("WA")
elif not s_not.islower()==True:
    print("WA")
else:
    print("AC")

Solution (Python):
S=input()
def judge(S):
    count=0
    count_1=0
    T=[]
    if(S[0]=="A"):
        T.append("a")
        T.append(S[1])
        for s in range(2,len(S)-1):
            if(S[s]=="C"):
                T.append("c")
                count_1+=1
            else:
                T.append(S[s])
        if(count_1==1):
            T.append(S[-1])
            R="".join(T)
            if(R.lower()==R):
                return "AC"
    return "WA"
print(judge(S))

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

Solution (Python):
n = input()
Flag = False

if n[0] == "A": 
    n = n[1:]
    if n[1:-1].count("C") == 1:
        n = n.replace("C","")
        if n == n.lower():
            Flag = True
if Flag:
    print("AC")
else:
    print("WA")

Solution (Python):
S = input()
mid = list(S[2:-1])
try:
    mid.remove('C')
except:
    pass
mid = ''.join(mid)
three = S[1] + mid + S[-1]

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

Solution (Python):
import string

S = input()

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

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

if S[1] == 'C' or S[-1] == 'C':
    print('WA')
    exit()

for s in string.ascii_uppercase.replace('C', ''):
    if s in S[1:]:
        print('WA')
        exit()

print('AC')

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

Solution (Python):
A=list(input())
n=len(A)
if(A[0]!="A"):print("WA")
elif(A.count("C")!=1):print("WA")
elif(A.index("C")<2 or A.index("C")>n-2):print("WA")
else:
  A.pop(A.index("C"))
  A.pop(0)
  S="".join(A)
  if(S.islower()):print("AC")
  else:print("WA")

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

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

Solution (Python):
S = input()

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

Solution (Python):
s = input()
state = False
if s.startswith('A'):
    if s[2:-1].count('C') == 1:
        if s.lstrip('A').replace('C', 'c') == s.lstrip('A').replace('C', 'c').lower():
            state = True

if state:
    print('AC')
else:
    print('WA')

Solution (Python):
n = input()
Flag = False

if n[0] == "A": 
    n = n[1:]
    if n[1:-1].count("C") == 1:
        n = n.replace("C","")
        if n == n.lower():
            Flag = True
if Flag:
    print("AC")
else:
    print("WA")

Solution (Python):
S=str(input())
output='WA'
if S[0]=='A':
    S=S.replace('A','a',1)
    if S[2:-1].count('C')==1:
        S=S.replace('C','c',1)
        if S.islower():
            output='AC'
print(output)

Solution (Python):
s = input()
wa = 0
if s[0] == 'A':
    s = s[1:]
else:
    wa = 1

for i in range(len(s)):
    if i in [0,len(s)-1]:
        continue
    if s[i] == 'C':
        s = s[:i]+s[i+1:]
        break
else:
    wa = 1

if not s.islower():
    wa = 1

if bool(wa):
    print('WA')
else:
    print('AC')

Solution (Python):

s=input()
s_l=s.lower()
sa=s[:2]
sc=s[2:-1]
flag=False

if s[0]=='A' and sc.count('C')==1 :
    sc=sc.replace('C','c')
    sa=sa.replace('A','a')
    if s_l==sa+sc+s[-1]:
        flag=True

print('AC' if flag==True else 'WA' )

Solution (Python):
S = input()
if S[0] == 'A' and S[2:-1].count('C') == 1:
  cnt = 0
  for s in S:
    if s.isupper():
      cnt += 1
  if cnt == 2:
    print('AC')
  else:
    print('WA')
else:
  print('WA')

Solution (Python):
import sys

S = input()
def judge_S(S):
    sliced_S = S[2:-1]
    if S[0] != "A":
        return "WA"
    else:
        S = S[1:]
    if sliced_S.count("C") != 1:
        return "WA"
    else:
        S = S.replace("C", "")
    if not S.islower():
        return "WA"

    return "AC"


print(judge_S(S))

Solution (Python):
A = input()
count = 0
if A[0]=="A":
    if A[2:-1].count("C")==1:
        A =A.replace("A","a",1)        
        SUM = A[0:2]+A[2:-1].replace("C","c") + A[-1]
        if SUM.islower():
            count = 1
            
print("AC") if count == 1 else print("WA")

Solution (Python):
S = input()

flag = False

if S[0] == 'A':
    S = S.strip('A')
    if S[1:-1].count('C') == 1:    
        S = S.replace('C', '')
        if S == S.lower():
            flag = True

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

Solution (Python):
S = input()

flag = False

if S[0] == 'A':
    S = S.strip('A')
    if S[1:-1].count('C') == 1:    
        S = S.replace('C', '')
        if S == S.lower():
            flag = True

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

Solution (Python):
s = raw_input()
a = (s[0] == 'A')
c = False
cx = -1
for i in range(2, len(s)-1):
	if s[i] == 'C':
		c = True
		cx = i
		break
other = True
for i in range(1, len(s)):
	if i != cx:
		if 65 <= ord(s[i]) and ord(s[i]) <= 90:
			other = False
status = 'WA'
if a and c and other: status = 'AC'
print status

Solution (Python):
def solution(s):
    
    if s[0] == 'A' and sum([1 for c in s if c =='C']) == 1 and sum([1 for c in s[2:-1] if c =='C']) == 1 and sum([1 for c in s if ord(c) <= ord('Z')]) == 2:
        return 'AC'
    return 'WA'

def main():
    s = raw_input().strip()
    print solution(s)

if __name__ == '__main__':
    main()

Solution (Python):
t=list(input())

if t[0]=="A" and not t[1]=="C" and not t[-1]=="C":
    rs=1
else:
    rs=0

if t[1].isupper()==True or t[-1].isupper()==True:
    rs -=1

del t[:2]
del t[-1]

if not t.count("C")==1:
    rs -=1

if rs==1:
    t.remove("C")

for i in t:
    if i.isupper()==True:
        rs -=1

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

Solution (Python):

	
def isSmall(c):
	return ord(c)>= ord('a') and ord(c)<=ord('z')


s = raw_input()
sl=list(s)

if sl[0]=='A' and sl[2:-1].count('C')==1 and len([c for c in sl if not isSmall(c)] )==2:
	print 'AC'
else:
	print 'WA'

Solution (Python):
s=raw_input()
if s[0]=="A" and len(s)>=3 and s.count("C")==1 and s[-1]!="C" and s[1]!="C" and all(x not in s[1:] for x  in"ABDEFGHIJKLMNOPQRSTUVWXYZ"):print "AC"
else:print "WA"

Solution (Python):
import re

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

Solution (Python):
S=input()

if S[0]=='A' :
    if 'C' in S[2:-1]:
        if S.count('C')==1:
            bl = True
            for s in S[1:]:
                if s<'a' and s !='C':
                    bl = False
            if bl:
                print('AC')
                exit(0)                
print('WA')

Solution (Python):
S=input()

if S[0]=='A' :
    if 'C' in S[2:-1]:
        if S.count('C')==1:
            bl = True
            for s in S:
                if s<'a' and s !='A' and s !='C':
                    bl = False
            if bl:
                print('AC')
                exit(0)                
print('WA')

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

Solution (Python):
import sys
s = input("")

count_c = 0

if(s[0] == "A"):
    for i in range(1, len(s)):

        if(s[i]=="C" and i >= 2 and i <= len(s)-2):
            count_c += 1
        elif(s[i].isupper()):
            print("WA")
            sys.exit()
            
        
    if(count_c != 1):
        print("WA")
    else:
        print("AC")
else:
    print("WA")

Solution (Python):
def m():
    s = str(input())
    if s[0] != "A":
        return "WA"
    if s[2:len(s)-1].count("C") != 1:
        return "WA"
    for c in s[1:]:
        if c == "C":
            continue
        if c.isupper():
            return "WA"
    return "AC"


print(m())

Solution (Python):
def checker():
    s = input()
    if s[0] != "A":
        return 0
    if s[2:-1].count("C") != 1:
        return 0
    num = s.index("C")
    s = s[1:num] + s[num+1:]
    if s != s.lower():
        return 0
    return 1

l = ["WA", "AC"]

print(l[checker()])

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

count = 0
check = 0

if S[0] == 'A':
    for i in range(len(S)-3):
        if S[i+2] == 'C':
            count += 1
    if count == 1:
        for j in range(len(S)-1):
            if S[j+1].islower() == False:
                check += 1
        if check == 1:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):

S = input()

state = ""

for i, char in enumerate(S):
    
    
    if state == "":
        if char == "A": state = "A"
        else: state = "WA"
    elif state == "A":
        if char == "C" and i < 2: state = "WA"
        elif char == "C": state = "C"
        elif char.isupper(): state = "WA"
        else: continue
    elif state == "C":
        if char == "C": state = "WA"
        elif char.isupper(): state = "WA"
        else: state = "AC"
    else: 
        if char.isupper(): state = "WA"
    
else:
    if state == "AC": print("AC")
    else: print("WA")

Solution (Python):
S = raw_input()
c1 = S[0] == 'A'
count, pos = 0, -1
for i in range(2, len(S)-1):
	if S[i] == "C":
		count += 1
		pos = i
c2 = count == 1

c3 = True
for i in range(len(S)):
	if i == 0 or i == pos:
		continue
	if S[i].isupper():
		c3 = False


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

Solution (Python):
s = input()
n = len(s)
if s[0] == 'A':
    counter = 0
    for i in range(2,n-1):
        if s[i] == 'C':
            counter += 1
    if counter == 1:
        check = True
        for i in range(n):
            if s[i] != 'A' and s[i] !='C':
                if s[i].isupper():
                    check = False
                    break
        if check:
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Solution (Python):
import re

S = input()

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

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

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

print('AC')

Solution (Python):
s=input()
l=len(s)
j=0
k=0

if s[0]=="A":
    for i in range(2,l-1):
        if s[i]=="C":
            j=i
            k+=1

if k==1:
    if s[1:j].islower() and s[j+1:l].islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
def ok(s):
    n = len(s)
    return (s[0] == "A") and \
        len(filter(lambda _: _=="C", s[2:n-1])) == 1 and \
        len(filter(lambda _: _.islower(), s)) == n-2

def solve(s):
    return "AC" if ok(s) else "WA"

assert solve("AtCoder") == "AC"
assert solve("ACoder") == "WA"
assert solve("AcycliC") == "WA"
assert solve("AtCoCo") == "WA"
assert solve("Atcoder") == "WA"
s = raw_input()
print solve(s)

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

Solution (Python):
S = input()
Ccount = 0
j = 0
hantei = False

for i in range(2, len(S)-1):
    if S[i] == "C":
        j = i
        Ccount += 1

if S[0] == "A":
    char_S = list(S)
    del char_S[j]
    del char_S[0]
    S = "".join(char_S)
    hantei = True

if (Ccount == 1) and (S.islower()) and hantei:
    print("AC")
else:
    print("WA")

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

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

Solution (Python):
import re
print(re.match("A[a-z]+C[a-z]+$",input())and"AC"or"WA")

Solution (Python):
import re
print(re.match(r"A[a-z]+C[a-z]+$",input())and"AC"or"WA")

Solution (Python):
s=input()
d=1
if not s[0]=='A':
    d=0
l=len(s)
t=0
for i in range(2,l-1):
    if s[i]=='C':
        t+=1
if not t==1:
    d=0
u=0
for i in range (l):
    if s[i]>='A' and s[i]<='Z':
        u+=1
if not u==2:
    d=0
if d:
    print('AC')
else:
    print('WA')

Solution (Python):
S = input()
if S[0] != 'A':
    print('WA')
elif S.count('C') != 1:
    print('WA')
elif 'C' not in S[2:-1]:
    print('WA')
else:
    upper = 0
    for c in S:
        if c.isupper():
            upper += 1
    print('AC' if upper == 2 else 'WA')

Solution (Python):
S = input()

ans = 'AC'

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

if cnt != 1:
    ans = "WA"
    
print(ans)

Solution (Python):
s = input()

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

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

if not count == 1:
    ans = 0

group = set([chr(i) for i in range(97, 97+26)])

num = 0
for i in range(len(s)):
    if s[i] in group:
        num += 1

if not num == len(s) - 2:
    ans = 0

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

Solution (Python):
from sys import stdin

S = stdin.readline().rstrip()

cond1 = S[0] == 'A'
cond2 = S.count('C', 2, -1) == 1
cond3 = S.replace('A', '').replace('C', '').islower()

if cond1 and cond2 and cond3:
    print('AC')
else:
    print('WA')

Solution (Python):
S = input()
l = len(S)
cnt = 0
cnt2 = 0
for i in range(l):
	if (S[i] != 'A' and i == 0):
		print("WA")
		exit(0)

	if (2 <= i and i < l-1 and S[i] == 'C'):
		cnt += 1

	if S[i].isupper():
		cnt2 += 1


if (cnt != 1 or cnt2 != 2):
	print("WA")
	exit(0)

print("AC")

Solution (Python):
s = input()
flag = True
if s[0] == "A":
  s2 = s[2:-1]
  if s2.count('C') == 1:
    for i in range(len(s)):
      if i == 0 or i == s.index('C'):
        continue
      else:
        if s[i].lower() != s[i]:
          flag = False
          break
  else:
    flag = False
else:
  flag = False

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

Solution (Python):
S = input()

lowStr = "abcdefghijklmnopqrstuvwxyz"
uppStr = lowStr.upper()

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

if S[1] in uppStr or S[-1] in uppStr:
  print("WA")
  exit(0)

fl = False

for i in range(2,len(S)):
  if S[i] in lowStr:
    continue
  elif S[i] == 'C':
    if fl:
      print("WA")
      exit(0)
    else:
      fl = True
  else:
    print("WA")
    exit(0)

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

Solution (Python):
x = list(input())


if x[0]=="A" :
	for i in range(2, len(x)-1, 1):
		if x[i]=="C":
			
			del	x[i]
			del x[0]
			y="".join(x)
			
			if y.islower():
				print("AC")
				break
			else:
				print("WA")
				break
	else:
		print("WA")

else:
	print("WA")

Solution (Python):
if __name__ == "__main__":
    S = input()
    ok = True
    if S[0] != 'A':
        ok = False
    cnt = 0
    for x in S[2:-1]:
        if x == "C":
            cnt += 1
    if cnt != 1:
        ok = False
    cnt = 0
    for x in S:
        if x.isupper():
            cnt += 1
    if cnt != 2:
        ok = False
    if ok:
        print ("AC")
    else:
        print ("WA")

Solution (Python):
s=input()
flag1,flag2,flag3=False,False,True
import string
for i,moji in enumerate(s):
    if i==0 and moji=="A":
        flag1=True
    elif 2<=i<=len(s)-2 and moji=="C" and flag2==False:
        flag2=True
    else:
        if moji in string.ascii_uppercase:
            flag3=False
            break
if flag1 and flag2 and flag3:
    print("AC")
else:
    print("WA")

Solution (Python):


def pHead(S):
    if S[0] != "A": return False
    return True

def getMid(S):
    return S[2:-1]

def pMid(S):
    mid = getMid(S)
    if "C" not in mid: return False
    if mid.count("C") > 1: return False
    return True

def getRest(S):
    mid = getMid(S)
    tmp = S[1] + mid.replace("C", "") + S[-1]
    return tmp

def solve(S):
    if not pHead(S):
        return "WA"
    if not pMid(S):
        return "WA"
    if not getRest(S).islower():
        return "WA"
    return "AC"

if __name__ == "__main__":
    S = input()
    print(solve(S))

Solution (Python):
import re

S = input()

pattern = r'^A[a-z][a-z]*C[a-z]*[a-z]$'

print('AC' if re.match(pattern, S) else 'WA')

Solution (Python):
import re

S = input()

pattern = r'^A[a-z][a-z]*C[a-z]*[a-z]$'

print('AC' if re.match(pattern, S) else 'WA')

Solution (Python):
from sys import stdin
s=stdin.readline().rstrip()
ans="AC"
if s[0]!='A':
	ans='WA'
if s.count('C',2,len(s)-1)!=1:
	ans='WA'
s2=s.replace('A','',1)
s2=s2.replace('C','',1)
if not s2.islower():
	ans='WA'
print(ans)

Solution (Python):
str = input()

result = "AC"

if str[0:1] != "A":
    result = "WA"
    
if "C" not in str[2:-1]:
    result = "WA"

if str.count("C") != 1:
    result = "WA"
    

str = str.replace("A", "")
str = str.replace("C", "")
if not str.islower():
    result = "WA"

print(result)

Solution (Python):
S = input()

if S[0] == "A":
    A = True
else:
    A = False

countC = 0
for i in range(2,len(S)-1):
    if S[i] == "C":
        countC += 1
        place = i
        
if countC == 1:
    C = True
else:
    C = False
    


'''
if C:
    for i in range(1,place):
        lower = S[i].islower()
        if lower == False:
            B = False
    for i in range(place+1,len(S)):
        lower = S[i].islower()
        if (lower):
            B = False
'''

B = False

new = ""
if C:
    for i in range(1,place):
        new = new + S[i]
    for i in range(place+1,len(S)):
        new = new + S[i]

    if new.islower():
        B = True
    else:
        B = False

            
if (A and B and C):
    print("AC")
else:
    print("WA")

Solution (Python):
S=str(input())
indC=S.find("C")
Flag=0

for i in range(0,len(S)):
    if i!=indC and i!=0:
        SSS=S[i]+""
        if SSS.isupper():
            Flag=1   

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

Solution (Python):

s = str(input())
j1 = (s[0]=='A')
j2 = False
j3 = False

if 1 == s[2:len(s)-1].count('C'):
    j2 = True
    idx = s[2:len(s)-1].index('C')
    j3 = (s[1:2+idx].islower() and s[2+idx+1:].islower())

if j1 is j2 is j3 is True:
    print ('AC')
else:
    print ('WA')

Solution (Python):
s=str(input())
if(s[0]!='A'):
    print('WA')
elif(s[2:len(s)-1].count('C')!=1):
    print('WA')
else:
    flag=0
    for i in s:
        if(ord(i)<97):
            if(i!='A' and i!='C'):
                flag=1
    if(flag==1):
        print('WA')
    else:
        print('AC')

Solution (Python):
str = input()
ans = 'WA'
if str[0] == 'A':
    cPlc = str.find('C')
    if cPlc >= 2 and cPlc <= len(str) - 2 and str.find('C',cPlc + 1) == -1:
        AllLower = True
        for i in range(1, len(str)):
            if str[i].isupper() and i != cPlc: AllLower = False
        if AllLower: ans = 'AC'
print(ans)

Solution (Python):
s=input()
flag1 = False
flag2 = False
flag3 = False

if s[0] == "A":
    flag1 = True
    
cnt = 0
idx = -1
for i in range(2, len(s)-1):
    if s[i]=="C":
        cnt += 1
        idx = i
if cnt == 1:
    flag2 = True
    
if flag2:
    flag3 = True
    for i in range(len(s)):
        if i != 0 and i != idx and s[i].lower()!=s[i]:
            flag3 = False

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

Solution (Python):
s=input()
flag1 = False
flag2 = False
flag3 = False

if s[0] == "A":
    flag1 = True
    
cnt = 0
idx = -1
for i in range(2, len(s)-1):
    if s[i]=="C":
        cnt += 1
        idx = i
if cnt == 1:
    flag2 = True
    
if flag2:
    flag3 = True
    for i in range(len(s)):
        if i != 0 and i != idx and s[i].lower()!=s[i]:
            flag3 = False

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

Solution (Python):
A = input()
if A[0] == "A":
    B = A[2: -1]
    C = B.count("C")
    if C == 1:
        D = A.replace("A", "").replace("C", "")
        E = D.islower()
        if E == 1:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    s = S()
    if s[0] != 'A':
        return 'WA'
    c = collections.Counter(s)
    if c['A'] != 1 or c['C'] != 1:
        return 'WA'
    if c['B'] > 0:
        return 'WA'
    for t in string.ascii_uppercase[3:]:
        if c[t] > 0:
            return 'WA'
    if 'C' not in s[2:-1]:
        return 'WA'
    return 'AC'


print(main())

Solution (Python):
S=input()
a1= (S[0]=="A")
s=S[2:-1]
a2=s.count("C")==1
ss=S.replace("A","").replace("C","")
a3= (ss==ss.lower())

if a1 & a2 & a3:
    print("AC")
else:
    print("WA")

Solution (Python):


import re

s = str(input())

if s[0] == "A":
    s = s[1:len(s)]

    s2 = s[1:len(s) - 1]
    arr = re.findall("C", s2)
    if len(arr) == 1:
        s2 = re.sub("C", "", s2)
        s = s[0] + s2 + s[len(s) - 1]

        if s.islower():
            print("AC")
            exit()

print("WA")

Solution (Python):
S = input()

flag = False

if S[0] == 'A' and S[2:-1].count('C') == 1 :
  if S.count('A') == 1 and S.count('C') == 1:
    if S.replace('A', 'a').replace('C','c').islower():
      flag = True

log = 'AC' if flag else 'WA'
print(log)

Solution (Python):
S = input()
n = len(S)
countc = 0
counta = 0
for m in range (3, n):
    if S[m-1] == 'C':
        countc = countc + 1
        S = S[:m-1] + 'c' + S[m:]
if S[1-1] == 'A':
    counta = 1
    S = 'a' + S[1:]
if(countc == 1 and counta == 1 and S.islower()):
    print('AC')
else:
    print('WA')

Solution (Python):
S=input()

T=S.count("C")

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

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

Solution (Python):


S=str(input())


length=len(S)
cnt=0
flg=1
ans="WA"
if S[0]=='A' and S.count('C')==1:
    

    ans="AC"
    for i in range(1,length):
        if S[i].isupper() and S[i]!='C':
            ans="WA"
            break
        elif S[i]=='C':
            if i<2 or i>(length-2):
                ans="WA"
                break
print(ans)

Solution (Python):
s = str(input())

ans = 'AC'

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

for i in range(1, len(s)):
    if s[i].isupper():
        if i == 1 or i == len(s) - 1 or s[i] != 'C':
            ans = 'WA'

if s.count('C') != 1:
    ans = 'WA'

print(ans)