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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:


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

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

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

    # 以上の A, C を除くSのすべての文字は小文字である。
    sl = s.lower()
    diff = len([s_ != sl_ for s_, sl_ in zip(s, sl)])
    if (diff - 2) != 0:
        return 'WA'

    return 'AC'


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
str = input()
s=list(str)
l=len(s)
f1=False
f2=False
f3=True
count=0


if(l<=10 and l>=4):
    for i in range(l):
        if(s[i].isalpha()):
            if(i==0 and s[i]=='A'):
                f1=True
            elif((i==2 or i==(l-2)) and s[i]=='C'):
                count+=1
            elif((i!=0 and i!=2 and i!=(l-2)) and s[i].isupper()):
                f3=False

if(f1==True and count==1 and f3==True):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

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


print(m())

Submission status: Wrong Answer

Solution code:
S = input()
a=0
if S[0] == "A" :
    a=1
b=0
if S[1].islower()==True and S[-2:].islower()==True :
    b=1
c=0
if S[2:-2].count("C") == 1 :
    c=1
x=0
y=0
z=0
for i in range(len(S[2:-2])) :
    if S[2+i] == "C" :
        x+=1
    elif S[2+i].isupper() == True :
        y+=1
    elif S[2+i].islower() == True :
        z+=1
if a==1 and b==1 and c==1 and x==1 and y ==0  :
    print("AC")
else :
    print("WA")

Submission status: Wrong Answer

Solution code:
str = input()
s=list(str)
l=len(s)
f1=False
f2=False
f3=True
count=0

if(l<=10 and l>=4):
    for i in range(l):
        if(s[i].isalpha()):
            if(i==0 and s[i]=='A'):
                f1=True
            elif((i<=2 and i>=(l-2)) and s[i]=='C'):
                count+=1
            elif((i!=0 and i<=2 and i>=(l-2)) and s[i].isupper()):
                f3=False

if(f1==True and count==1 and f3==True):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
print('WA')

Submission status: Wrong Answer

Solution code:
str = input()
s=list(str)
l=len(s)
f1=False
f2=False
f3=True
count=0

if(l<=10 and l>=4):
    for i in range(l):
        if(s[i].isalpha()):
            if(i==0 and s[i]=='A'):
                f1=True
            elif((i<=2 or i>=(l-2)) and s[i]=='C'):
                count+=1
            elif((i!=0 and i!=2 and i!=(l-2)) and s[i].isupper()):
                f3=False

if(f1==True and count==1 and f3==True):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = input("")
L = len(X)
Y = X[2:L-2]
    
if L >= 4 and L <= 10 and X[0] == "A" and Y.count('C') == 1:
  print("AC")
else :
  print("WA")

Submission status: Wrong Answer

Solution code:
import re
x = input()
C_index = 0
def calc1():
    return x[0] == 'A'

def calc2():
    if len(re.findall('C', x[2:-2])) == 1:
        C_index = int(x.find('C'))
        return  True


def calc3():
    for i in range(0,len(x)):
        if x[i] ==  x[0] or x[i] == x[C_index]:
            continue
        elif x[i].isupper():
            return False
            break
        else:
            continue
        return True
     

if calc1() and calc2() and calc3():
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
l = list(input())
length = len(l)

a = 0
for i in range(2,length-2):
    if l[i] == "C":
        a += 1
        
b = 0
for i in range(length):
    if l[i].isupper() == True:
        b += 1

if l[0] == "A":
    if a == 1:
        if b == 2:
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
S = input()

if S[2:-2].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:-2].index('C')+2] = 'c'
        if ''.join(S).islower():
          print('AC')
        else:
          print('WA')

Submission status: Wrong Answer

Solution code:
str = input()
s=list(str)
l=len(s)
f1=False
f2=False
f3=True
count=0

if(l<=10 and l>=4):
    for i in range(l):
        if(s[i].isalpha()):
            if(i==0 and s[i]=='A'):
                f1=True
            elif((i==2 or i==(l-2)) and s[i]=='C'):
                count+=1
            elif((i!=0 and i!=2 and i!=(l-2)) and s[i].isupper()):
                f3=False

if(f1==True and count==1 and f3==True):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
S = input()
a=0
if S[0] == "A" :
    a=1
b=0
if S[1].islower()==True and S[len(S)-2:len(S)-1].islower()==True :
    b=1
c=0
if S[2:-2].count("C") == 1 :
    c=1
x=0
y=0
z=0
for i in range(len(S[2:-2])) :
    if S[2+i] == "C" :
        x+=1
    elif S[2+i].isupper() == True :
        y+=1
if a==1 and b==1 and c==1 and x==1 and y ==0 :
    print("AC")
else :
    print("WA")

Submission status: Wrong Answer

Solution code:
str = input()
s=list(str)
l=len(s)
f1=False
f2=False
f3=True
count=0

print(s[l-1])

if(l<=10 and l>=4):
    for i in range(l):
        if(s[i].isalpha()):
            if(i==0 and s[i]=='A'):
                f1=True
            elif((i==2 or i==(l-2)) and s[i]=='C'):
                count+=1
            elif((i!=0 and i!=2 and i!=(l-2)) and s[i].isupper()):
                f3=False

if(f1==True and count==1 and f3==True):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
import re
x = input()
C_index = 0
def calc1():
    return x[0] == 'A'

def calc2():
    if len(re.findall('C', x[2:-2])) == 1:
        C_index = int(x.find('C'))
        return  True


def calc3():
    for i in range(0,len(x)):
        if x[i] ==  x[0] and x[i] == x[C_index]:
            pass
        elif x[i].isupper():
            return False
            break
        else:
            pass
        return True
     

if calc1() and calc2() and calc3():
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
n=input()
l=list(n)
num=len(l)-2
if l[0]!='A':
    print('WA')
elif l[0]!='C':
    print('WA')
elif '?' not in l:
    print('WA')
elif l[0]=='C' or l[1]=='C' or l[-1]=='C':
    print('WA')
else:
    l.remove("A")
    l.remove('C')
    str=''
    for x in l:
        s=str+x
    if s.islower()=='False':
        print('WA')
    else:
        print('AC')

Submission status: Wrong Answer

Solution code:
S = input()
count = 0
tmp = ""
flag = False
if S[0] == 'A':
    for i in range(len(S)-1):
        if i != 0 and i != 1 and i != len(S)-1:
            if S[i] == "C":
                count += 1
            else:
                tmp += S[i]
    # print(tmp)
    if count == 1:
        if tmp.islower() == True:
            print("AC")
            flag = True

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

Submission status: Wrong Answer

Solution code:
import re
x = input()
C_index = 0
def calc1():
    return x[0] == 'A'

def calc2():
    if len(re.findall('C', x[2:-2])) == 1:
        C_index = int(x.find('C'))
        return  True


def calc3():
    for i in range(0,len(x)):
        if x[i] ==  x[0] or x[i] == x[C_index]:
            pass
        elif x[i].isupper():
            return False
            break
        else:
            pass
        return True
     

if calc1() and calc2() and calc3():
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
str = input()
s=list(str)
l=len(s)
f1=False
f2=False
f3=True
count=0

if(l<=10 and l>=4):
    for i in range(l):
        if(s[i].isalpha()):
            if(i==0 and s[i]=='A'):
                f1=True
            elif((i==2 or i==(l-1)) and s[i]=='C'):
                count+=1
            elif((i!=0 and i!=2 and i!=(l-1)) and s[i].isupper()):
                f3=False

if(f1==True and count==1 and f3==True):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

if s[0] == 'A':
  if s.find('C') >= 2 and s.find('C') <= len(s)-1:
    if len(list(filter(lambda x: x.islower(), s))) == len(s)-2:
      print('AC')
      exit()

print('WA')

Submission status: Wrong Answer

Solution code:
str = input()
s=list(str)
l=len(s)
f1=False
f2=False
f3=True

if(l<=10 and l>=4):
    for i in range(l):
        if(s[i].isalpha()):
            if(i==0 and s[i]=='A'):
                f1=True
            elif((i==2 or i==(l-1)) and s[i]=='C'):
                f2=True
            elif((i!=0 and i!=2 and i!=(l-1)) and s[i].isupper()):
                f3=False

if(f1==True and f2==True and f3==True):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
import re
s = input()
print('AC' if s[0].isupper() and (s[2:-2].count('C') == 1 or (s[2:-2] == '' and s[2] == 'C')) and len(re.findall('[a-z]', s)) == len(s) - 2 else 'WA')

Submission status: Wrong Answer

Solution code:
S = input()
S1 = list(S)
i = 0

if ((S1[0] == 'C')or(S1[1] == 'C') or (S1[-1] == 'C')):
    print('WA')
elif ((S1[0] == 'A') and (S1.count('A') == 1) and (S1[2:-1].count('C') == 1)):
    S1.remove('A')
    S1.remove('C')
    while i <= len(S1):
        i += 1
        if S1[i].isupper():
            print('WA')
        break
    else:
        print('AC')
else:
    print('WA')

Submission status: Wrong Answer

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

if s[0] == 'A':
  if s[:3].count('C') == 1 ^ s[l-2:].count('C') == 1:
    try:
      idx = s[:3].index('C')
    except:
      pass
    try:
      idx = s[l-2:] + l-2
    except:
      pass
    if s[1:idx].islower() and s[idx+1:].islower():
      print('Yes')
      quit()
print('WA')

Submission status: Wrong Answer

Solution code:
import re
s = input()
c = 'C'
if s[0].isupper():
    S = s[2:-2]
    if S.count('C') == 1 or (S == '' and s[2] == 'C'):
        if len(re.findall('[a-z]', s)) == len(s) - 2:
            print('AC')

Submission status: Wrong Answer

Solution code:
S=input()
count=0
Judge=True
#print(Judge)
if S[0]!="A":
    Judge=False
    #print(Judge)
for i in S[2:-1]:
    if i=="C":
        count+=1
    elif i.isupper():
        Judge=False
        #print("1")
        #print(Judge)
if count!=1:
    Judge=False
    #print("2")
    #print(Judge)
if S[1].isupper():
    Judge=False
    #print("3")
    #print(Judge)

if Judge==False:
    print("WA")
else:
    print("AC")

Submission status: Wrong Answer

Solution code:
B = input()
S = B
a = 0
if S[0] == "A":
    if S[2:-2].count("C") == 1:
        if "C" in S[2:-2]:
            t = 2 + S[2:-2].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")
    S = S.replace("A", "")
    if S.islower():
        pass

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

Solution code:
str = input()
s=list(str)
l=len(s)
f1=False
f2=False
f3=True

for i in range(l):
    if(i==0 and s[i]=='A'):
        f1=True
    elif((i==2 or i==(l-1)) and s[i]=='C'):
        f2=True
    elif((i!=0 and i!=2 and i!=(l-1)) and s[i].isupper()):
        f3=False

if(f1==True and f2==True and f3==True):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
S = input()

if S[2:-2].count('C') != 1:
  print('WA')
else:
    if S[0] != 'A':
      print('WA')
    else:
        S[0] == 'a'
        S[S[2:-2].index('C')] == 'c'

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = input("")
L = len(X)
N = len(X)
Y = X[2:N-1]
    
if L >= 4 and L <= 10 and X[0] == "A" and Y.count('C') == 1:
  print("AC")
else :
  print("WA")

Submission status: Wrong Answer

Solution code:
S = input()
S1 = list(S)
i = 0

if ((S1[0] == 'C')or(S1[1] == 'C') or (S1[-1] == 'C')):
    print('WA')
elif ((S1[0] == 'A') and (S1.count('A') == 1) and (S1[2:-1].count('C') == 1)):
    S1.remove('A')
    S1.remove('C')
    while i <= len(S1):
        if S1[i].isupper():
            print('WA')
            i += 1
        break
    else:
        print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
ac = 0
S = input()
a = 0
if S[0] == "A":
    a = 1
b = 0
if S[1].islower() == True :
    b = 1
T = S[2:-2]
#print(T)
c = 0
if T.count("C") == 1 :
    c = 1
d = 0
if S[-2].islower() == True and S[-1].islower() == True :
    d = 1
e = 0
U = list(T)
checker = 0
for i in range(len(U)) :
    if U[i].isupper() == True :
        checker += 1
if checker == 1 :
    e = 1

if a == 1 and b == 1 and c == 1 and d == 1 :
    if e == 1 :
        print("AC")
        ac = 1
if ac == 0 :
    print("WA")

Submission status: Wrong Answer

Solution code:
str = input()
s=list(str)
l=len(s)
f1=False
f2=False
f3=False

for i in range(l):
    if(i==0 and s[i]=='A'):
        f1=True
    elif((i==2 or i==(l-1)) and s[i]=='C'):
        f2=True
    elif((i!=0 and i!=2 and i!=(l-1)) and s[i].islower()):
        f3=True

if(f1==True and f2==True and f3==True):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
S = input()
S1 = list(S)
i = 0

if ((S1[0] == 'C')or(S1[1] == 'C') or (S1[-1] == 'C')):
    print('WA')
elif ((S1[0] == 'A') and (S1[2:-1].count('C') == 1)):
    S1.remove('A')
    S1.remove('C')
    while i <= len(S1):
        if S1[i].isupper():
            print('WA')
            i += 1
        break
    else:
        print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
import re

s = input()

c_pos = re.findall('C',s)
if len(c_pos) !=1:
  print("WA")
elif len(re.findall(r'A[a-z]+C[a-z]+',s)) == 0:
  print("WA")
elif s[0] == "A" and s[2:-1].count("C") == 1 and re.search(r'[A-Z]',s[1:]).group() == "C":
  print("AC")
else:
  print("WA")

Submission status: Wrong Answer

Solution code:
S = input()
S1 = list(S)
i = 0

if ((S1[0] == 'C')or(S1[1] == 'C') or (S1[-1] == 'C')):
    print('WA')
elif ((S1[0] == 'A') and (S1[2:-1].count('C') == 1)):
    S1.remove('A')
    S1.remove('C')
    while i <= len(S1):
        if S1[i].isupper():
            print('WA')
            i += 1
        break
    else:
        print('AC')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=input()
count=0
Judge=True
if S[0]!="A":
    Judge=False
for i in S[2:-1]:
    if i=="C":
        count+=1
    elif i.isupper():
        Judge=False
if count!=1:
    Judge=False
if Judge==False:
    print("WA")
else:
    print("AC")

Submission status: Wrong Answer

Solution code:
S = list(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
S1 = list(S)
i = 0

if ((S1[1] == 'C') or (S1[-1] == 'C')):
    print('WA')
elif ((S1[0] == 'A') and (S1[2:-1].count('C') == 1)):
    S1.remove('A')
    S1.remove('C')
    while i <= len(S1):
        if S1[i].isupper():
            print('WA')
            i += 1
        break
    else:
        print('AC')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# s = raw_input()
s="AxCc"
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:
                        "AC"
                    else:
                        "WA"
                else:
                    "WA"
            else:
                "WA"
    else:
        "WA"
else:
    "WA"

Submission status: Wrong Answer

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

x = input()


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

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

    return 'AC'

print(b_mon(x))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
S1 = list(S)
i = 0

if ((S1[1] == 'C') or (S1[-1] == 'C')):
    print('WA')
elif ((S1[0] == 'A') and (S1[2:-1].count('C') == 1)):
    S1.remove('A')
    S1.remove('C')
    while i <= len(S1):
        if S1[i].islower():
            print('AC')
            i += 1
        break
        
else:
    print('WA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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

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

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
word = input('')

ans = 'WA'


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

Submission status: Wrong Answer

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

    if judge == True or C == 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 s[-2].isupper() or judge(s):
        print('WA')
    else:
        print('AC')

Submission status: Wrong Answer

Solution code:
def main():
    a = input()
    tmp = 0
    pos = 0
    if a[0] == 'A':
        for i in range(2, len(a)-2):
            if a[i] == 'C':
                tmp += 1
                pos = i
        if tmp == 1:
            for i in range(len(a)):
                if i != 0 and i != pos:
                    if a[i].isupper():
                        print('WA')
                        return
            print('AC')
            return
    print('WA')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    a = input()
    tmp = 0
    pos = 0
    if a[0] == 'A':
        for i in range(2, len(a)-2):
            if a[i] == 'C':
                tmp += 1
                pos = i
        if tmp == 1:
            for i in range(len(a)):
                if i != 0 and i != pos:
                    if a[i].isupper():
                        print('WA')
                        return
            print('AC')
            return
        print('WA')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
S = input()
L = len(S)
Flag = True
if not S[0] == 'A':
    Flag = False
cnt = 0
a = str(S[1])
for i in range(2,L-1):
    if S[i] == 'C':
        cnt += 1
    else:
        a += S[i]

if a.islower() and cnt == 1:
    pass
else:
    Flag = False
if Flag:
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
word = input('')

ans = 'WA'


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

Submission status: Wrong Answer

Solution code:
S=input()
if S[0]!="A":
  print("WA")
elif len([i for i in S[3:-1] if i == "C"]) != 1:
  print("WA")
elif len([i for i in S if i.islower()]) != len(S)-2:
  print("WA")
else:
  print("AC")

Submission status: Wrong Answer

Solution code:
S = list(input())
flagx = 0
flagy = 0
if S[0] == "A":
  S.pop(0)
else:
  flagx = 1
  
for i in range(len(S)-2):
  if S[i] == "C":
    S.pop(i)
    flagy = 0
    break
  else:
    flagy = 1
    
if str(S).islower() and flagx == 0 and flagy == 0:
  print("AC")
else:
  print("WA")

Submission status: Wrong Answer

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

S_check = []
a = []
b = []
if S[0] == 'A':
    for i in range(2,S_len-1):
        if S[i] == 'C':
            S_check.append(1)
    if len(S_check) == 1:
        a = re.findall('A', S)
        b = re.findall('C', S)
        if len(a) == 1 and len(b) == 1 :
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
s=input()

l=len(s)
c=0
p=-1
#print("inp ",s[2:l-1])
for i, j in enumerate(s):
#        print("no3 ",j)
        if 1<=i and i<=l-2 and j=="C":
#                print("C!")
#                print(i, j)
                c+=1
                p=i

s2=s.lower()
#print(c, p, s[1:p],s2[1:p],s[p+1:],s2[p+1:])

if c==1 and s[0]=="A" and s[1:p]==s2[1:p] and s[p+1:]==s2[p+1:]:
        s2=s.lower()
        print("AC")
else:
    print("WA")