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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

S = input()

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

Submission status: Accepted

Solution code:
s=input()
if s[0]!='A' or s[-1]=='C':
    print('WA')
    exit()
elif s[2:-1].count('C') !=1:
    print('WA')
    exit()
s=s[1:]
r='qazwsxeCdcrfvtgbyhnujmikolp'
for c in s:
    if c not in r:
        print('WA')
        exit()
print('AC')

Submission status: Accepted

Solution code:
import sys
S = input()

if S[0] != 'A':
    print('WA')
    sys.exit()
elif sum([1 for c in S[2:-1] if c == 'C']) != 1:
    print('WA')
    sys.exit()
else:
    for c in S:
        if ord('A') <= ord(c) <= ord('Z') and not c in ['A', 'C']:
            print('WA')
            sys.exit()
print('AC')

Submission status: Accepted

Solution code:
from collections import Counter

S = raw_input()
ok1 =  S[0] == 'A'
c = Counter(S[2:len(S)-1])
ok2 = ('C' in c) and (c['C'] == 1)
c = Counter(S[1:])
ok3 = True
if 'C' in c and c['C'] > 1:
    ok3 = False
for cc in c.keys():
    if cc != 'C' and cc.isupper():
        ok3 = False
print "AC" if ok1 and ok2 and ok3 else "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:
s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1:
    index = s.index('C')
    s = s[1:index] + s[index+1:]
    if s.islower():
        print('AC')
        exit()
print('WA')

Submission status: Accepted

Solution code:
import sys

s=input()

c_count=0
s_count=0
for i in range(len(s)):
    if i==0 and s[i]!="A":
        print('WA')
        sys.exit()
    if 2<=i<=len(s)-2:
        if s[i]=="C":
            c_count+=1
    if s[i].islower():
        s_count+=1
if c_count==1 and s_count==len(s)-2:
    print('AC')
else:
    print('WA')

Submission status: Accepted

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

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

X = 0
for s in S:
    if s.lower() != s:
        X += 1

if X != 2:
    print("WA")
else:
    print("AC")

Submission status: Accepted

Solution code:
S = input()

Ans = "WA"
if S[0]=="A" and S[2:-1].count("C")==1:
    cnt = 0
    for s in S[1::]:
        if s in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
            cnt += 1
    if cnt == 1:
        Ans = "AC"

print(Ans)

Submission status: Accepted

Solution code:
S = raw_input()
if S[0]=="A" and S[2:-1].count("C")==1 and sum(s==s.lower() for s in S)==len(S)-2:
  print "AC"
else:
  print "WA"

Submission status: Accepted

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)

# Debug output


def chkprint(*args):
    names = {id(v): k for k, v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg), '???')+' = '+repr(arg) for arg in args))

# Binary converter


def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]

# --------------------------------------------


dp = None


def main():
    lower = "abcdefghijklmnopqrstuvwxyzAC"
    S = input()

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

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

    for s in S:
        if s not in lower:
            print("WA")
            return

    print("AC")


main()

Submission status: Accepted

Solution code:
def good(s):
    if s[0] != 'A':
        return False

    cocc = 0
    for x in range(2, len(s) - 1):
        if s[x] == 'C':
            cocc += 1

    if cocc != 1:
        return False

    s = s[1:]
    p = s.index('C')
    s = s[:p] + s[p + 1:]
    return all(c in 'abcdefghijklmnopqrstuvwxyz' for c in s)

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

main()

Submission status: Accepted

Solution code:
s = raw_input()
if s[0] != 'A':
    print "WA"
else:
    c = 0
    occur = -1
    for i in xrange(2, len(s)-1):
        if s[i] == 'C':
            c += 1
            occur = i
    if c != 1:
        print "WA"
    else:
        good = True
        for i in xrange(1, len(s)):
            if i == occur:
                continue
            good = good and s[i].islower()
        print "AC" if good else "WA"

Submission status: Runtime Error

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

Submission status: Runtime Error

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

res = "AC"

if s[0] != "A":
  res = "WA"
c = 0
for i in range(2,n-2):
  if s[i].isupper:
    if s[i] != "C":
      res = "WA"
    else:
      c += !
if c != 1:
  res = "WA"
print(res)

Submission status: Runtime Error

Solution code:
S = input()

flag = 1
if S[0] == 'A':
  c_count = 0
  for i in range(1,len(S)):
    if 2 <= i <= len(S)-2:
      if S[i] == 'C':
        c_count += 1
    else:
      if S[i].islower() == False:
        flag = 0
else:
  flag = 0
if c_count == 1 and flag == 1:
  print('AC')
else:
  print('WA')

Submission status: Runtime Error

Solution code:
s = list(input())
al = list("abcdefghijklmnopqrstuvwxyz")
if s[0] == "A" and s[-1] in al and s[1] in al:
    del s[0]
    del s[0]
    del s[-1]
    f = 0
    for i in s:
        if i == "C":
            if f == 1:
                print("WA")
                break
            else:
                f = 1
                continue
        else:
            if i in al:
                continue
            else:
                print("WA")
                break
    else:
        if f = 1:
            print("AC")
        else:
            print("WA")
else:
    print("WA")

Submission status: Runtime Error

Solution code:
s = list(input())
flg = "WA"
if s[0]=="A":
  if "C" in s[2:len(s)-1]:
    s.remove("A")
    s.remove("C")
    s = *s
    if s.islower()==True:
      flg = "AC"
print(flg)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()
if s[0]!="A":
  print("WA")
  exit()
else:
  s.pop(0)
  if s[1]!="C" or s[-2]!="C":
    print("WA")
    exit()
  else:
    s.pop(1)
    s.pop(-2)
    if s.islower():
      print("AC")
    else:
      print("WA")

Submission status: Runtime Error

Solution code:
s=list(input())
fld="WA"
if s[0]=="A":
  if "C" in s[2:len(s)-1]:
    s.remove("A")
    s.remove("C")
    s=' '.join(s)
    if s.islower()==True:
      flg="AC"

print(flg)

Submission status: Runtime Error

Solution code:
s=list(input())
fld="WA"
if s[0]=="A":
  if "C" in s[2:len(s)-1]:
    s.remove("A")
    s.remove("C")
    s=''.join(s)
    if s.islower()==True:
      flg="AC"

print(flg)

Submission status: Runtime Error

Solution code:
def isAC(S):
    if S[0] != 'A':
        return False
    if S[2:-1].count('C') != 1:
        return False
    S = S.remove('C')
    if not all('a' <= x <= 'z' for x in S):
        return False
    return True

print('AC' if isAC(input()) else 'WA')

Submission status: Runtime Error

Solution code:
s=input()
n=len(s)
if(s.count('C')==1):
    x=s.index('C')
c=0
for i in s:
    if(i.islower()):
        c+=1
if(s[0]=='A' and (x>=2 and x<=n-2) and c==n-2):
    print('AC')
else:
    print("WA")

Submission status: Runtime Error

Solution code:
S= input()
count=0
if S[0]!='A':
  print('WA')
  return
S.lower(0)
for i in range(3,len(S)-1):
  if S[i]=='C':
    count+=1
    S.lower(i)
if count==1 && S.islower():
  print('AC')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
s = list(input())
if s[0] == "A" and s[2:-1].count("C") == 1:
  cnt = 0
  for i in s:
    if s.isupper():
      cnt += 1
  if cnt == 2:
    print("AC")
    sys.exit()
print("WA")

Submission status: Runtime Error

Solution code:
s = input()

wa = False

if s[0] != 'A':
  wa = True
print(s[2:-1])
if s[2:-1].count('C') != 1:
  wa = True

l_s = list(s)
  
del l_s[l_s.index('A')]

if 'C' in l_s:
	del l_s[l_s.index('C')]

for c in l_s:
  print(c.lower())
  if c != c.lower():
    wa = True
    
if wa == True:
  print('WA')
else:
  print('AC')

Submission status: Runtime Error

Solution code:
s = input()

wa = False

if s[0] != 'A':
  wa = True

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

l_s = list(s)
  
del l_s[l_s.index('A')]
del l_s[l_s.index('C')]

for c in l_s:
  if c != c.lower():
    wa = True
    
if wa == True:
  print('WA')
else:
  print('AC')

Submission status: Runtime Error

Solution code:
s=input()
res="AC"
if s[0]=="A":res="WA"
elif s[2:-2].count("C")!=1:res="WA"
else:
    li=list(s)
    li.remove("A")
    li.remove("C")
    for i in li:
        if i!=i.lower():
            res="WA"
print(res)

Submission status: Runtime Error

Solution code:
s = input()

a = -1
c = -1
lower = 0
for i in range(len(s))
  if s[i] == 'A':
    a = i
  if s[i] == 'C':
    c = i
  if 'a' <= s[i] <= 'z':
    lower += 1

if a == 0 and 2 <= c <= len(s) - 2 and lower == len(s) - 2:
  print('AC')
else:
  print('WA')

Submission status: Runtime Error

Solution code:
S = input()
sl = []
ans = 'AC'

for i in S:
    sl.append(i)
if sl[0] != 'A':
    ans = 'WA'
if sl[2:-1].count('C') != 1:
    ans = 'WA'

if sl[1:].replace("C","c",1).islower() == False:
    ans = 'WA'
#print(sl)
print(ans)

Submission status: Runtime Error

Solution code:
S = input()
sl = []
ans = 'AC'

for i in S:
    sl.append(i)
if sl[0] != 'A':
    ans = 'WA'
if sl[2:-1].count('C') != 1:
    ans = 'WA'
sl.pop(0)
sl.pop(sl.index('C'))
s = "".join(sl)
#print(s)
if s.islower() == False:
    ans = 'WA'
#print(sl)
print(ans)

Submission status: Runtime Error

Solution code:
S = input()
sl = []
ans = 'AC'

for i in S:
    sl.append(i)
if sl[0] != 'A':
    ans = 'WA'
if sl[2:-1].count('C') != 1:
    ans = 'WA'
sl.pop(0)
sl.pop(sl.index('C'))
s = "".join(sl)

if s.islower() == False:
    ans = 'WA'
#print(sl)
print(ans)

Submission status: Runtime Error

Solution code:
s = input()

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

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

s = s.replace('C',"")

if s[1:].isLower():
        print('AC')
else:
        print('WA')

Submission status: Runtime Error

Solution code:
S = input()
flag = True
count = 0
if not S[0] == "A":
  flag = False
for i in range(2,len(S)-1):
  if S[i] == "C":
    count += 1
  else:
    if not S[len(S)].islower():
      flag = False 
if not S[len(S)].islower():
  flag = False
if not count == 1:
  flag = False
if flag:
  print("AC")
else:
  print("WA")

Submission status: Runtime Error

Solution code:
S=input()
K="WA"
if S[0]=="A":
  a=0
  for i in range(3,len(S)-1):
    if S[i]=="C":
      a+=1
  X="QWERTYUIOPSDFGHJKLZXVBNM"
  if a==1:
    for i in range(1,len(S)):
      if A[i] not in X:
        K="AC"
print(K)

Submission status: Runtime Error

Solution code:
import collections
print 'AC' if ( r[0] == 'A' and  collections.Counter(r[2:-1])['C'] == 1 and  all([l in set(['A', 'C']) or l.lower() ==l for l in r ])) else 'WA'

Submission status: Runtime Error

Solution code:
S = list(input())
l = [chr(i) for i in range(65, 65+26)]

flag = True
if S[0] != 'A':
    flag = False
elif S[1] in l:
    flag = False
elif S[len(S)] in l:
    flag = False
elif not 'C' in S[2:len(S) - 2]:
    flag = False
count = 0
for i in range(2, len(S) - 1):
    if flag == False:
        break
    if S[i] in l:
        count += 1
    if count > 1:
        flag = False
if count < 1:
    flag = False
if flag:
    print('AC')
else:
    print('WA')

Submission status: Runtime Error

Solution code:
import string

s = list(input())
flag = True
if s[0] != "A":
    flag = False
s.pop(0)
if s.count("C") > 1:
    flag = False
s_index = s.index("C")
if 2 >= s_index or s_index <= (len(s) - 3):
    flag = False
s.pop(s_index)
for i in s:
    if i not in string.ascii_lowercase:
        flag = False

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

Submission status: Runtime Error

Solution code:
rint("a", ord("a"))
print("z", ord("z"))

s = input()
n = len(s)
ans = 1
if s[0] != "A":
    ans *= 0
if not (97 <= ord(s[1]) <= 122):
    ans *= 0
if not (97 <= ord(s[-1]) <= 122):
    ans *= 0

check = 0
for i in range(1, n - 1):
    if s[i] == "C":
        check += 1
print(["WA", "AC"][ans & (check == 1)])

Submission status: Runtime Error

Solution code:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

s = s()

if s[0] != "A":
	f1 = True  
cnt = 0
for i in range(2,len(s)-1):
	if s[i] == "C":
		cnt += 1
if cnt1 == 1:
	f2 =True
cnt2 = 0
for i in range(1,len(s)):
	if s[i].islower():
		cnt2 += 1
if cnt2 >= len(s) -2:
	f3 = True

if f1 and f2 and f3:
	print("AC")
else:
	prinet("WA")

Submission status: Runtime Error

Solution code:
s = input()
ans = "WA"

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

Submission status: Runtime Error

Solution code:
s = input()
ans = "AC"
if s[0] == "A":
  c_cnt = 0
  for i in range(2,len(s)-1):
    if s[i] == "C":
      c_cnt += 1
  if c_cnt = 1:
    for i in s:
      if i.lower() != "a" and i.lower() != "c" and i.lower() != i:
        ans = "WA"
        break
  else:
    ans = "WA"
else:
  ans = "WA"
print(ans)

Submission status: Runtime Error

Solution code:
S=input()
cnt=0
if S[0]!='A':
    print('WA')
else:
    for a in S[2:-1]:
        if a=='C':
            cnt+=1
    if cnt==1:print('AC')
    else:print('WA

Submission status: Runtime Error

Solution code:
S=input()
cnt=0
if S[0]!='A':
    print('WA')
    break
else:
    for a in S[2:-1]:
        if a=='C':
            cnt+=1
    if cnt==1:print('AC')
    else:print('WA')

Submission status: Runtime Error

Solution code:
R=int(input())
if R<1200:S='B'
elif R<2800:S='R'
else:S='G'
print('A'+S+'C')

Submission status: Runtime Error

Solution code:
import sys
S = list(input())
C_cnt,low,upp = 0,0,0
if S[0] != "A" or S[-1].isupper()
  print("WA")
  sys.exit()
for i in range(1,len(S)-1):
  if S[i] == "C":
    C_cnt += 1
  elif S[i].islower():
    low += 1
  elif S[i].isupper():
    upp += 1
if C_cnt = 1 and low = len(S)-3 and upp = 0:
  print("AC")
else :
  print("WA")

Submission status: Runtime Error

Solution code:
s=input()
ans='AC'
if s[0]!='A':
  ans='WA'
elif s[2:-1].count('C')!=1:
  ans='WA'
s=sorted(s)
if s[2:].islower()==False:
  ans='WA'
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
n = len(s)
res = 0
  
if s[0] == 'A':
  if s.find('C') >= 2 and s.find('C') < n-2:
    s.lower(0)
    s.lower(s.find('C'))
    if s == s.lower():
      print('AC')
    else:
      print('WA')
  else:
    print('WA')
else:
  print('WA')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()
k = False
if s[0] != 'A':
    print('WA')
    exit()
else:
    for i in range(len(s)-1):
        if s[i] == 'C':
            s = s[1:i-1] + s[i+1:]
            k =s.islower()
print('AC' if k else 'WA')

Submission status: Runtime Error

Solution code:
s = str(input())
 
if s[0] != 'A':
    print('WA')
    break
else:
    for i in range(len(s)-1):
        if s[i] == 'C':
            s = s[1:i-1] + s[i+1:]
            break
    if s.islower() == True:
        print('AC')
    else:
        print('WA')

Submission status: Runtime Error

Solution code:
s = str(input())

if s[0] != A:
    print('WA')
    break
else:
    for i in range(len(s)-1):
        if s[i] == C:
            s = s[1:i-1] + s[i+1:]
            break
    if s.islower() == True:
        print('AC')
    else:
        print('WA')

Submission status: Runtime Error

Solution code:
s = input()

if s[0] != "A" or (s[2] != "C" and s[-1] != "C"):
  print("WA")
elif s[0] == "A" and s[2] == "C":
  s = list(s)
  s.pop(0)
  s.pop(1)
  for i in s:
    if s[i] != s[i].lower():
      print("WA")
      exit()
elif s[0] == "A" and s[-1] == "C":
  s = list(s)
  s.pop(0)
  s.pop(-1)
  for i in s:
    if s[i] != s[i].lower():
      print("WA")
      exit()
      
print("AC")

Submission status: Runtime Error

Solution code:
s=list(input())
if s[0]!='A':
  print("WA")
elseif s[2:len(s)-1].count("C")!=1:
  print('WA')
else:
  s.remove('A')
  s.remove('C')
  ns=str(s)
  if ns.islower():
    print("AC")
  else:
    print("WA")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = str(input())
ans = 0
if s[0] == 'A':
    for i in range(3, len(s)-1):
        if s[i] == 'C':
            ans += 1
        if s[i].isupper() or s[1].isuuper():
            print('WA')
            exit()
    
    if ans == 1:
        print('AC')
        exit()
else:
    print('WA')

Submission status: Runtime Error

Solution code:
s = input()
    res = "AC"
    for i in s:
        if (i!="A" and i!="C" and i.isupper() == True):
            res = "WA"
            break;

    if (res == "AC" and s[0]=="A" and s.count("C")==1 and  s.index("C")>1 and s.index("C")<len(s)-1 ):
        print("AC")
    else:
        print("WA")

Submission status: Runtime Error

Solution code:
S=input()
print("AC" s[0]="A" and s[2]="C" and s.count("C")<2 else "WA")

Submission status: Runtime Error

Solution code:
def main():
    S = input()
    l = len(S)
    if S[0] == "A" and S[2:l - 1].count("C") == 1 and (S[1] + S[3:l - 2] + S[l]).islower():
        print("AC")
    else:
        print("WA")


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
def main():
    S = int(input())
    l = len(S)
    if S[0] == "A" and S[2:l - 1].count("C") == 1 and (S[1] + S[3:l - 2] + S[l]).islower():
        print("AC")
    else:
        print("WA")


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
S = input()
flag = 1
if S[0] != "A":
  flag = 0
if S[2:-2].count("C") != 1:
  flag =0
S.remove("A")
S.remove("C")
if not(S.islower()):
  flag = 0
print("AC" if flag else "WA")

Submission status: Runtime Error

Solution code:
S=list(input())
t=0
if S[0]=='A' and S[2:-3].count('C')==1 :
    t=1  
S.remove('A')
S.remove('C')
for i in S:
    if i.isupper():
        t=0
if t==1:
    print('AC')
else:
    print('WA')

Submission status: Runtime Error

Solution code:
s = input()
if s[0] == "A":
    x = s.find("C")
    if 2<=x and x != len(s)-1:
        s[0]="a"
        s[x]="c"
        if s.islower():
            print("AC")
            exit()
print("WA")

Submission status: Runtime Error

Solution code:
S = input()
flag = True
Cflag = False
for i, c in enumerate(S):
    if i == 0:
        if c == "A":
            continue
        else:
            flag = False
            break

    if c == "C" and i >= 2:
        if Cflag:
            flag = False
        cflag = True
    elif not (97 <= ord(c) <= 122):
        flag = False

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

Submission status: Runtime Error

Solution code:
s = input()
flag = True
flag = flag and s[0] == 'A'
Ccount = 0
for i in range(1,len(s)):
  if ord('a') <= ord(s[i]) and ord(s[i]) <= 'z': continue
  if s[i] == 'C' and 2 <= i and i <= len(s)-2:
    Ccount += 1
  else:
    flag = False
print("AC" if flag and Ccount == 1 else "WA")

Submission status: Runtime Error

Solution code:
S = list(input())

if S[0] != 'A':
    print('WC')
elif 'C' not in S[2:-1]:
    print('WC')
else:
    S.remove('A')
    S.remove('C')
    for c in S:
        if c.is_upper():
            print('WC')
    else:
        print('AC')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
S = input()
if S[0] != 'A' or :
    print('WA')
    sys.exit()
    
n = len(S)
ct = 0
for i in range(1, n):
    if S[i].islower():
        if i == 1 or i == n - 1 or S[i] != 'C':
            print('WA')
            sys.exit()
        ct += 1
if ct == 1:
    print('AC')
else:
    print('WA')

Submission status: Runtime Error

Solution code:
s = list(input())

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

frag = True
for i in range(2,len(s)-2):
  if s[i]=='C':
    frag = False
    del s[i]

if frag:
  print("WA")
  exit()
  
if not "".join(s[1:]).islower():
  print("WA")
else:
  print("AC")

Submission status: Runtime Error

Solution code:
import copy
s=list(input())
if s[0]=='A' and 'C' in s[2:len(s)] :
  t=copy.copy(s)
  s.remove('A')
  s.remove('C')
  result=''.join(s)
  if len(s)==len(t)-2 and result.islower()==True and t[len(s-1)]!='C':
    print('AC')
  else:
    print('WA')
    
else:
  print('WA')

Submission status: Runtime Error

Solution code:
import copy
s=list(input())
if s[0]=='A' and 'C' in s[2:len(s)] :
  t=copy.copy(s)
  s.remove('A')
  s.remove('C')
  result=''.join(s)
  if len(s)==len(t)-2 and result.islower()==True and t[s-1]!='C':
    print('AC')
  else:
    print('WA')
    
else:
  print('WA')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=str(input())
letter="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
condition1 = S[0]=='A'
condition2 = len([1 for x in S[2:len(S)-1] if x=="C"]) == 1
count=0
for i in len(S):
  if len([1 for x in letter if x==S[i]]) == 1:
    count = count + 1
condition3 = count == 2
if condition1 & condition2 & condition3:
  print('AC')
else:
  print('WA')

Submission status: Runtime Error

Solution code:
S=str(input())
letter="ABCDEFGHIJKLMNO"
condition1 = S[0]=='A'
condition2 = len([1 for x in S[2:len(S)-1] if x=="C"]) == 1
condition3 = len([1 for x in S if len([1 for y in letter if y>10])==1]) == 2
if condition1 & condition2 & condition3:
  print('AC')
else:
  print('WA')

Submission status: Runtime Error

Solution code:
s = input()
a=s.index('C')
print('AC' if s[0]=='A' and s.count('C')==1 and s[1:a]+s[a+1:]==(s[1:a]+s[a+1:]).lower() and 1<a<len(s)-1 else 'WA')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
x = len(S)
capC = 0
lowchar = 0
if S[0] != 'A':
    print('WA')
    exit()
if ord(S[1]) <= 90:
    print('WA')
    exit()
if ord(S[-1]) <= 90:
    print('WA')    
for i in range(2,x-1):
    if S[i] == 'C':
        capC += 1
    elif 97 <= ord(S[i]):
        lowchar += 1

if capC != 1:
    print('WA')
    exit()
if lowchar != N-3:
    print('WA')
    exit()

print('AC')

Submission status: Runtime Error

Solution code:
s = list(input())

bl = True

if s[0] != 'A':
    bl = False
if s[2:len(s)-1].count('C') != 1:
    bl = False
if s[0] != 'A' and s[2:len(s)-1].count('C') != 1:
    s.remove('A')
    s[2:len(s)-1].remove('C')
    if s not in 'abcdefghijkrmnopqlstuvwxyz':
        bl = False

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

Submission status: Runtime Error

Solution code:
S = str(input())
s = list(S)
p = 0
for i in range(2,len(s)-1):
        if s[i] == 'C':
            p = p + 1
            del s[i]
if s[0] == 'A':
    del s[0]
    if p == 1:
        q = ''.join(s)
        if q.islower() == True:
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Submission status: Runtime Error

Solution code:
from collections import Counter
l=input()
s=list()
k=0
if s[0]=='A':
    for i in range(2,len(s)-1):
        if s[i]=='C':
            k+=1
    if k==1:
        if l.replace('A', 'a').replace('C', 'c') == l.lower():print('AC')
        else:print('WA')
    else:print('WA')
else:print('WA')

Submission status: Runtime Error

Solution code:
from collections import Counter
s=list(input())
k=0
if s[0]=='A':
    for i in range(2,len(s)-1):
        if s[i]=='C':
            k+=1
    if k==1:
        if s.replace('A', 'a').replace('C', 'c') == s.lower():print('AC')
        else:print('WA')
    else:print('WA')
else:print('WA')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = input()
S = list(a)
S_low = list(a.lower())

count = 0
if S[0] == "A":
    count += 1

vaa = 0
for j in range(2, len(S)-1):
    # print(j)
    if S[j] == "C":
        vaa += 1
        num = j
        # print(j)
if vaa == 1:
    count += 1

val = 0
for i in range(len(S)):
    for j in range(len(S)):
        if j == 0 or j == num:
            continue
        else:
            if S[i] == S[j]:
                val += 1
            else:
                continue
if val == len(S)-2:
    count +=1

if count == 3:
    print("AC")
else:
    print("WA")

Submission status: Runtime Error

Solution code:
S = input()

#c_index = S.index('C')
if S[0] != 'A':
    print('WA')
    quit()
elif S.count('C') != 1:
    print('WA')
    quit()
c_index = S.index('C')
elif 2 > c_index or c_index > len(S) - 2:
    print('WA')
    quit()
else:
    disc = S[1:c_index] + S[c_index + 1:]
alpha = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(disc)):
    if not disc[i] in alpha:
        print('WA')
        quit()
    else:
        continue
print('AC')

Submission status: Runtime Error

Solution code:
S = input()

c_index = S.index('C')
if S[0] != 'A':
    print('WA')
    quit()
elif S.count('C') != 1:
    print('WA')
    quit()
#c_index = S.index('C')
elif 2 > c_index or c_index > len(S) - 2:
    print('WA')
    quit()
else:
    disc = S[1:c_index] + S[c_index + 1:]
alpha = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(disc)):
    if not disc[i] in alpha:
        print('WA')
        quit()
    else:
        continue
print('AC')
#print(disc)

Submission status: Runtime Error

Solution code:
S = input()

flag = False
if S[0] != 'A':
    print('WA')
    quit()
elif S.count('C') != 1:
    print('WA')
    quit()
elif S[2] == 'C' or S[-2] == 'C':
    c_index = S.index('C')
    if c_index == 2:
        disc = S[1] + S[3:]
    else:
        disc = S[1:len(S) - 1] + S[-1]
alpha = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(disc)):
    if not disc[i] in alpha:
        print('WA')
        quit()
    else:
        continue
print('AC')
#print(disc)