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 = list(input())

count = []
code_pass = False
if s[0] == "A":
    capital_count = 0
    for i in range(len(s)):
        
        if "C" == s[i]:
            count.append(i)
            

        if s[i].isupper():
            capital_count += 1
            

    if len(count) == 1 and 2 <= count[0] <= len(s)-2:
        if capital_count == 2:
            code_pass = True

if code_pass == True:
    print("AC")
else:
    print("WA")

Solution (Python):
import re
s = input()
ci = s.find("C")
if s.find("A") == 0 and 2 <= ci <= len(s) - 2:
  tmp = list(s)
  del tmp[0]
  del tmp[ci - 1]
  if re.match("^[a-z]*$", "".join(tmp)):
    print("AC")
    exit()
print("WA")

Solution (Python):
def main():
    S = input()
    if S[0] != "A":
        return "WA"
    elif S[2:-1].count("C") != 1:
        return "WA"
    else:
        alf = "abcdefghijklmnopqrstuvwxyz"
        flag = "AC"
        for s in S[1:len(S)]:
            if (not s == "C") and (not s in alf):
                flag = "WA"
    return flag

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

Solution (Python):
s = str(input())
s2 = s.replace("A", "a", 1)
s2 = s2.replace("C", "c", 1)
if s[0] != "A" or s.count("C", 2, -1) != 1 or not s2.islower():
    print("WA")
else:
    print("AC")

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

if s[2:len(s)-1].count('C') == 1:
    b = 1
else:
    b = 10
count = 0
ss = 'qwertyuioplkjhgfdsazxcvbnm'
for i in s:
    if i in ss:
        count += 1
if count == len(s)-2:
    c = 1
else:
    c = 10

if a+b+c == 3:
    print('AC')
else:
    print('WA')

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

if S[0] != "A":
    print("WA")
elif "C" in S[2:-1]:
    S.remove("C")
    del S[0]
    S = str(S)
    if S.islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
import sys
S = list(input())



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






elif "C" in S[2:-1]:
    S.remove("C")
    del S[0]
    S = str(S)
    if S.islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):
import sys
S = list(input())



if S[0] != "A":
    print("WA")
    sys.exit()
elif S[1].isupper():
    print("WA")
    sys.exit()
elif S[-1].isupper():
    print("WA")
    sys.exit()
elif "C" in S[2:-1]:
    S.remove("C")
    del S[0]
    S = str(S)
    if S.islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Solution (Python):

a = str(input())
b = "AC"
if (a[0:1] != 'A'): b = 'WA'
if (not a[1:2].islower()): b = 'WA'
if (a[2:-1].count('C') != 1): b = 'WA'
if (not a[2:-1].replace('C', 'c').islower()): b = 'WA'
if (not a[-1].islower()): b = 'WA'

print(b)

Solution (Python):
s = input()
f = [True]

if s[0]!="A":
    f[0]=False

slice1 = s[2:-1]
if slice1.count("C")!=1:
    f[0]=False
if (slice1.count("C")==1)and(s[0]=="A"):
    s=s.replace("A","a")
    s=s.replace("C","c")

if s.islower()!=True:
    f[0]=False

if f[0]==True:
    print("AC")
if f[0]==False:
    print("WA")

Solution (Python):
S = input()
l = len(S)
flug = 0
if S[0] == "A":
	S = S.replace("A","a")
	if S.count("C")==1 and S.find("C") > 1 and S.find("C") < l-1:
		S = S.replace("C","c")
		if S.lower() == S:
			flug = 1

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

Solution (Python):
import sys

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

Solution (Python):
s=input()
d='BDEFGHIJKLMNOPQRSTUVWXYZ'
if s[0]=='A' and s.count('A')==1 and s.count('C')==1 and s[2:-1].count('C')==1:
    for t in d:
        if t in s:
            break
    else:
        print('AC')
        exit()
print('WA')

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

Solution (Python):
s = input()
lib = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

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

else:
	print("WA")

Solution (Python):


S = input()

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

Solution (Python):
S = list(input())
flags = [False,False,False]
if S.pop(0) == "A":
    flags[0] = True
if flags[0] == True: 
    if S[1:len(S)-1].count("C") == 1:
        flags[1] = True
        del S[1+S[1:len(S)-1].index("C")]
if flags[1] == True:
    if "".join(S) == "".join(S).lower():
        flags[2] = True
if False in flags:
    print("WA")
else:
    print("AC")

Solution (Python):
import re
p = re.compile(r'^A[a-z]{1,}C[a-z]{1,}$')

S = input()
if bool(p.match(S)):
    print('AC')
else:
    print('WA')

Solution (Python):
from collections import Counter

s = input()

head = s[0]
mid  = dict(Counter(s[2:-1]))
removed = s.replace('A', '').replace('C', '')
if head == 'A' and mid.get('C') is not None and mid['C'] == 1 and removed == removed.lower():
  print('AC')
else:
  print('WA')

Solution (Python):
S = input()

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

Solution (Python):
str=list(input())
flag=False
for i in range(len(str)):
    if(str[i]!='A' and str[i]!='C'):
        if(ord(str[i])>=ord('a') and ord(str[i])<=ord('z')):
            flag=True
        else:
            flag=False
            break
if(flag and str[0]=='A' and 'C' in str[2:len(str)-1:1] and str.count('C')==1):
    print("AC")
else:
    print("WA")

Solution (Python):
def main():
    S = input()

    ans = f(S)
    ans = regex(S)

    print(ans)


def f(S):
    if S[0] != "A":
        return "WA"

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

    import string
    for c in S[1] + S[-1]:
        if c in string.ascii_uppercase:
            return "WA"

    return "AC"


def regex(S):
    import re

    r = re.compile("^A[a-z][^C]*C[^C]*[a-z]$")
    if r.match(S):
        return "AC"
    else:
        return "WA"


if __name__ == '__main__':
    main()

Solution (Python):
if __name__ == '__main__':
    s = input()
    
    if s[0] != 'A':
        print('WA')
        exit(0)

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

    c_index = s.find('C')
    s_sub = ""
    for i, c in enumerate(s):
        if i == 0 or i == c_index:
            continue
        s_sub += c

    if not s_sub.islower():
        print('WA')
        exit(0)

    print('AC')

Solution (Python):
S=input()
if S[0]!='A':
    print('WA')
elif S[1].isupper():
    print('WA')
else:
    count=0
    flag=0
    for i in range(2,len(S)-1):
        if S[i]=='C':
            count+=1
        else:
            if S[i].isupper():
                flag=1
    if count==1 and flag==0 and S[len(S)-1].islower():
        print('AC')
    else:
        print('WA')

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):
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)

Solution (Python):

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

Solution (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')
else:
    print('WA')

Solution (Python):
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')

Solution (Python):

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

Solution (Python):
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')

Solution (Python):
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')

Solution (Python):
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')

Solution (Python):

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

Solution (Python):
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")

Solution (Python):



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

Solution (Python):



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

Solution (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"

Solution (Python):

import re

in_data = input()

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

Solution (Python):
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")

Solution (Python):

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'

Solution (Python):
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")

Solution (Python):
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')

Solution (Python):
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)

Solution (Python):
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")

Solution (Python):
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')

Solution (Python):
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")

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

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

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

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

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

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

Solution (Python):
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')

Solution (Python):


def solve(s):
    

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

    
    
    
    if len([True for c in s[2:-1] if c == 'C']) != 1:
        return 'WA'

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

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

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

Solution (Python):
import re


def solve(s):
    

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

    
    
    
    s_ = s[2:-1]
    if len([True for c in s_ if c == 'C']) != 1:
        return 'WA'

    
    n_capital = len(re.findall('[A-Z]', s))
    if (n_capital - 2) != 0:
        return 'WA'

    return 'AC'


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

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

Solution (Python):
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')

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

Solution (Python):
import sys
S=input()
N=len(S)

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

Solution (Python):
import sys
S=input()
N=len(S)

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

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

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):
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()

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

Solution (Python):
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')

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

test()

Solution (Python):




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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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")

Solution (Python):
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')

Solution (Python):
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')

Solution (Python):
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")

Solution (Python):
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')

Solution (Python):
import re

s = input()


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

Solution (Python):

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

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

Solution (Python):
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')

Solution (Python):
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')

Solution (Python):
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")

Solution (Python):
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()

Solution (Python):

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

Solution (Python):
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')

Solution (Python):

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

Solution (Python):
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')

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):
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))

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):

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"

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):
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'

Solution (Python):
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"

Solution (Python):
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'