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

flg = "AC"

if s[0] != "A":
    flg ="WA"

if {"C"}  <= set(list(s)[2:-1]):
    pass
else:
    flg ="WA"
    
if list(s)[2:-1].count("C") !=1:
    flg = "WA" 
    
a = [chr(i) for i in range(97, 97+26)]
a.append("A")
a.append("C")
if  set(list(s)) <= set(a):
    pass
else:
    flg == "WA"
    
print(flg)

Submission status: Wrong Answer

Solution code:
s = input()

flg = "AC"

if s[0] != "A":
    flg ="WA"

if {"C"}  <= set(list(s)[2:-2]):
    pass
else:
    flg ="WA"

a = [chr(i) for i in range(97, 97+26)]
a.append("A")
a.append("C")
if  set(list(s)) <= set(a):
    pass
else:
    flg == "WA"
    
print(flg)

Submission status: Wrong Answer

Solution code:
s = input().rstrip()
 
ans = 'WA'
if s[0] == 'A' and s[2:len(s) - 1].count('C') == 1:
  i = s[2:len(s) - 1].find('C')
  if s[1:i+2].islower() and s[i + 2 + 1:].islower():
    ans = 'AC'

Submission status: Wrong Answer

Solution code:
s = input().rstrip()
 
ans = 'WA'
if s[0] == 'A' and s[2:len(s) - 1].count('C') == 1:
  i = s[2:len(s) - 2].find('C')
  if s[1:i+2].islower() and s[i + 2 + 1:].islower():
    ans = 'AC'
print(ans)

Submission status: Wrong Answer

Solution code:
s = input().rstrip()
 
ans = 'WA'
if s[0] == 'A' and s[2:len(s) - 2].count('C') == 1:
  i = s[2:len(s) -2].find('C')
  if s[1:i+2].islower() and s[i + 2 + 1:].islower():
    ans = 'AC'
print(ans)

Submission status: Wrong Answer

Solution code:
s = input().rstrip()

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
k="WA"
for i in range(2,len(s)-1):
    if s[0]=="A" and "C"==s[i] and s.count("C")==1:
        k="AC"
print(k)

Submission status: Wrong Answer

Solution code:
s=input()
k="WA"
for i in range(2,len(s)-1):
    if s[0]=="A" and "C"==s[i]:
        k="AC"
print(k)

Submission status: Wrong Answer

Solution code:
# AtCoder Beginner Contest 104 B
S = input()
if S[0] == 'A' and S[2:-1].count('C') == 1:
  C_pos = S[2:-1].count('C') + 1
  S_changed = 'a' + S[1:C_pos] + 'c' + S[C_pos+1:]
  if S_changed.islower():  
    print('AC')
  else:
    print('WA')  
else:
  print('WA')

Submission status: Wrong Answer

Solution code:
s = list(input())
flag = 0
count = 0

if s[0] == 'A':
    flag += 1
#print(flag)
a = s.pop(0)
b = s.pop(0)
c = s.pop(-1)

if s.count('C') == 1:
    flag += 1
#print(flag)
if flag ==2:
    s.append(b)
    s.append(c)
    print(s)
    for i in range(len(s)):
        if s[i].islower():
            count += 1
        print(count)
    if (count+1) == len(s):
        flag += 1
##print(flag)
if flag == 3:
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
s = list(input())
flag = 0
count = 0

if s[0] == 'A':
    flag += 1

a = s.pop(0)
b = s.pop(0)
c = s.pop(-1)

if s.count('C') == 1:
    flag += 1
if flag ==2:
    s.append(b)
    s.append(c)
    print(s)
    for i in range(len(s)):
        if s[i].islower():
            count += 1
        print(count)
    if (count+1) == len(s):
        flag += 1
print(flag)
if flag == 3:
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
flag = True
if s[0] != 'A':
    flag = False
elif 'C' not in s[2:-1]:
    flag = False
else:
    s=list(s)
    s.remove('C')
    if not str(s[1:]).islower():
        flag = False
        print('rrr')

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

Submission status: Wrong Answer

Solution code:
s = input()


li = "abdefghijklmnopqrstuvwxyz"
li = li.upper()
li = list(li)

if s[0] == "A" and "C" in s[2:-1] and s.count("C") == 1:
    for i in li:
        if i not in s[1:]:
            pass
        else:
            print("WA")
    else:
        print("AC")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
s = input()


li = "abcdefghijklmnopqrstuvwxyz"
li = li.upper()
li = list(li)

if s[0] == "A" and "C" in s[2:-1] and s.count("C") == 1:
    for i in li:
        if i not in s[1] and i not in s[-1]:
            pass
        else:
            print("WA")
    else:
        print("AC")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
S_ = input()
S = list(S_)
flag = True

if S[0] == 'A':
    S.pop(0)
    big = []
    for i in range(1, len(S)-2):
        if S[i] == 'C':
            big.append(i)
    if len(big) == 1:
        S.pop(big[0])
        for s in S:
            if s.isupper():
                flag = False
    else:
        flag = False
else:
    flag = False

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s_list=list(input())

def out_wa():
  print('WA')

if s_list[0]!='A':
  out_wa()
else:
  count=0
  for i in range(2,len(s_list)-2):
    if s_list[i] == 'C':
      count+=1

  if count != 1:
    out_wa()
  else:
    s = ''.join(s_list)
    l_s=s.lower()
    print(s)
    print(l_s)
    if l_s !=s:
      out_wa()
    else:
      print('AC')

Submission status: Wrong Answer

Solution code:
s_list=list(input())

def out_wa():
  print('WA')

if s_list[0]!='A':
  out_wa()
else:
  count=0
  for i in range(2,len(s_list)-1):
    if s_list[i] == 'C':
      count+=1

  if count != 1:
    out_wa()
  else:
    s = ''.join(s_list)
    l_s=s.lower()
    print(s)
    print(l_s)
    if l_s !=s:
      out_wa()
    else:
      print('AC')

Submission status: Wrong Answer

Solution code:
S = input()

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

if S[0] != 'A':
  print("WA")
if S.count('C', 2, -1) != 1:
  print("WA")
i = S.find('C', 2, -1)
S = S[1:i] + S[i+1:]
if all('a' <= c <= 'z' for c in S):
  print("AC")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import Counter
s=input()
a=len(s)
counter = Counter(s[2:a-1])
if s[0]!="A":
  print("WA")
  
elif counter["C"]!=1:
  
    print("WA")
else:
  
  s[1:].replace("C","c",1)
  if s[1:].islower()==True:
    print("WA")
  else:
    print("AC")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

cnt = 0
for c in s:
    if c.isupper():
        cnt = cnt + 1

if cnt != 2:
    print("WA")
    exit()

if not s[0].isupper() and s[0] == "A":
    print("WA")
    exit()

if s[2:len(s)-1].count("C") == 1:
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
s = input()

cnt = 0
for c in s:
    if c.isupper() and c == "A":
        cnt = cnt + 1

if cnt != 2:
    print("WA")
    exit()

if not s[0].isupper():
    print("WA")
    exit()

if s[2:len(s)-1].count("C") == 1:
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
s = input()

cnt = 0
for c in s:
    if c.isupper():
        cnt = cnt + 1

if cnt != 2:
    print("WA")
    exit()

if not s[0].isupper():
    print("WA")
    exit()

if s[2:len(s)-1].count("C") == 1:
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
if (s[0]=='A')and (s[2:-1].count('C')==1):
    s = s.replace('A','').replace('C','')
    for c in s:
        try: c.upper()
        except:
            print("WA")
            exit()
    print("AC")
else: print("WA")

Submission status: Wrong Answer

Solution code:
S = input()
alp = "abcdefghijklmnopqrstuvwxyzC"
ans = "AC"
if S[0] != "A":
    ans = "WA"
flag = 0
for C in S:
    if C == "C":
        flag+=1
if flag != 1:
    ans = "WA"
for c in S[1:]:
    if not c in alp:
        ans = "WA"
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
print(S[2:-1])
#if S[0] == 'A' and 'C' in S[2:-1] and S[1:].replace('C', '', 1).lower():
#	print('AC')
#else:
#	print('WA')

Submission status: Wrong Answer

Solution code:
S = input()
if S[0] == 'A' and 'C' in S[2:-1] and S[1:].replace('C', '', 1).lower():
	print('AC')
else:
	print('WA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

S = list(input())
ans=0
cou=2
Ccou=0
rep=len(S)-2
if S[0]=='A':
    ans=+1
rep=len(S)-2
for i in range(0,rep):
    if S[cou]=='C':
        Ccou=Ccou+1
    cou=cou+1
if Ccou == 1:
    ans=ans+1
if ans ==2:
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:

S = list(input())
ans=0
cou=2
Ccou=0
rep=len(S)-2
if S[0]=='A':
    ans=+1
rep=len(S)-2
for i in range(1,rep):
    if S[cou]=='C':
        Ccou=Ccou+1
    cou=cou+1
if Ccou == 1:
    ans=ans+1
if ans ==2:
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
x = input()
ans = 'AC'
flag=0
for i in range(len(x)):
    if x[i] != 'A' and i==0:
        ans = 'WA'
    elif 0<i<len(x)-1 and str.isupper(x[i]):
        if x[i]=='C' and 1<i<len(x)-2:
            flag+=1;
        else:
            ans= 'WA'
if flag!=1:
    ans = 'WA'
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
check = 0
tmp = S[2:-1].split('C')
if (S[0]=='A') and (len(tmp)==2):
    for i in range(len(tmp)):
        if tmp[i].lower() == tmp[i]:
            check += 1
    if check == len(tmp):
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
S = input()
check = 0
tmp = S[2:-1].split('C')
if (S[0]=='A') and (len(tmp)==2) and S[1].lower()==S[1]:
    for i in range(len(tmp)):
        if tmp[i].lower() == tmp[i]:
            check += 1
    if check == len(tmp):
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
S = input()
check = 0
tmp = S[2:-1].split('C')
if (S[0]=='A') and (len(tmp)==2) and S[1].lower()==S[1]:
    for i in range(len(tmp)):
        if tmp[i].lower() != tmp[i]:
            check += 1
    if check == len(tmp):
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
s  = input()
f = True
if s[0] != "A":
    f = False
c = 0
for i in range(2, len(s) - 1):
    if s[i] == "C":
        c += 1

if c != 1:
    f=False
ss = s[1:].replace("C", "")
for i in range(len(ss)):
    if ss[i] < "A" or ss[i] > "z":
        f = False

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

Submission status: Wrong Answer

Solution code:
s  = input()
f = True
if s[0] != "A":
    f = False
c = 0
for i in range(2, len(s) - 1):
    if s[i] == "C":
        c += 1
if c != 1:
    f=False
ss = s[1:].replace("C", "")
for i in range(len(ss)):
    if ss[i] < "A" or ss[i] > "z":
        f = False
        print("3")

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

Submission status: Wrong Answer

Solution code:
from string import ascii_lowercase
S = input()
if not S[0] is 'A' or not S[2] is 'C':
    print('WA')
    exit()
for i in range(1,len(S)):
    if i == 2:
        continue
    if not S[i] in ascii_lowercase:
        print('WA')
        exit()
print('AC')

Submission status: Wrong Answer

Solution code:
import sys
S = str(input())
#print (S)
if S[0:1] == 'A':
    S2 = S[2:-1]
    a = S2.count('C')
    b = S.count ('C')
    c = S.count ('A')
    print (S2)
    if a == 1 and b == 1 and c == 1:
        for i in S:
            if i == 'A' or i == 'C':
                pass
            else:
                if i != i.lower():
                    print ('WA')
                    sys.exit()
        print ('AC')
        sys.exit()
print ('WA')

Submission status: Wrong Answer

Solution code:
import sys
S = str(input())
#print (S)
if S[0:1] == 'A':
    S2 = S[2:-2]
    a = S2.count('C')
    b = S.count ('C')
    c = S.count ('A')
    if a == 1 and b == 1 and c == 1:
        for i in S:
            if i == 'A' or i == 'C':
                pass
            else:
                if i != i.lower():
                    print ('WA')
                    sys.exit()
        print ('AC')
        sys.exit()
print ('WA')

Submission status: Wrong Answer

Solution code:
import sys
S = str(input())
#print (S)
if S[0:1] == 'A':
    S2 = S[2:-2]
    a = S2.count('C')
    b = S.count ('C')
    if a == 1 and b == 1:
        for i in S:
            if i == 'A' or i == 'C':
                pass
            else:
                if i != i.lower():
                    print ('WA')
                    sys.exit()
        print ('AC')
        sys.exit()
print ('WA')

Submission status: Wrong Answer

Solution code:
s = input()
ans = 'WA'
if s[0] == 'A':
    if s[2:-1].count('C') == 1:
        position = s[2:-1].find('C')+2
        if position == 2 and s[position+1:].islower():
            ans='AC'
        elif position == len(s) - 1 and s[2:position].islower() and s[-1].islower():
            ans='AC'
        elif s[2:position].islower() and s[position+1:].islower():
            ans = 'AC'

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
ans = 'WA'
if s[0] == 'A':
    if s[2:-1].count('C') == 1:
        position = s[2:-1].find('C')+2
        if position == 2 and s[position+1:].islower():
            ans='AC'
        elif position == len(s) - 1 and s[2:position].islower():
            ans='AC'
        elif s[2:position].islower() and s[position+1:].islower():
            ans = 'AC'

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

if len(s):
    if(s[0] == "A") and (s[2] == "C"):
        print("AC")
    else:
        print("WA")

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
S = input()
flag = False
if S[0]=='A':
        flag = True
        count = 0
        for i in range(2,len(S)-1):
                if S[i]=='C': 
                        if count==0: count+=1
                        else:
                                flag = False
                                break
        if count==0: flag = False
        if flag:
                for i in range(len(S)):
                        if S[i]=='c' or S[i] == 'a':
                                flag = False
                                break
                        else:
                                if S[i]!='C' and S[i]!='A' and S[i].upper()==S[i]:
                                        flag = False
                                        break
if flag: print("AC")
else: print("WA")

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
s = input()

if s[0] == "A" and s[2:-2].count("C") == 1:

    s = s[1:].replace("C", "c")
    if s.islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
s = input()

if s[0] == "A" and s[2:-3].count("C") == 1:

    s = s[1 : s.find("C") -1] +  s[s.find("C") + 1:]
    if s.islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
s = input()

if s[0] == "A" and s[2:-2].count("C") == 1:
    s = s[1:]
    c_index = s.find("C")
    s = s[0:c_index-1] +  s[c_index + 1:]
    if s.islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
from sys import stdin
import re

S = stdin.readline().rstrip()
print(S)

pattern1 = r"^A([a-z])C([a-z]{1,7})$"
pattern2 = r'^A([a-z]){2}C([a-z]{1,6})$'
pattern3 = r'^A([a-z]){3}C([a-z]{1,5})$'
pattern4 = r'^A([a-z]){4}C([a-z]{1,4})$'
pattern5 = r'^A([a-z]){5}C([a-z]{1,3})$'
pattern6 = r'^A([a-z]){6}C([a-z]{1,2})$'
pattern7 = r'^A([a-z]){7}C([a-z]{1})$'

if (re.match(pattern1, S)) or (re.match(pattern2, S)) or (re.match(pattern3, S)) or (re.match(pattern4, S)) \
        or (re.match(pattern5, S)) or (re.match(pattern6, S)) or (re.match(pattern7, S)):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
from sys import stdin
import re

S = stdin.readline().rstrip()

pattern1 = r"A[a-z]C[a-z]{1,7}"
pattern2 = r'A[a-z]{2}C[a-z]{1,6}'
pattern3 = r'A[a-z]{3}C[a-z]{1,5}'
pattern4 = r'A[a-z]{4}C[a-z]{1,4}'
pattern5 = r'A[a-z]{5}C[a-z]{1,3}'
pattern6 = r'A[a-z]{6}C[a-z]{1,2}'
pattern7 = r'A[a-z]{7}C[a-z]{1}'

if (re.match(pattern1, S)) or (re.match(pattern2, S)) or (re.match(pattern3, S)) or (re.match(pattern4, S)) \
        or (re.match(pattern5, S)) or (re.match(pattern6, S)) or (re.match(pattern7, S)):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
from sys import stdin
import re

S = stdin.readline().rstrip()

pattern1 = r'A[a-z]C[a-z]{1, 7}'
pattern2 = r'A[a-z]{2}C[a-z]{1, 6}'
pattern3 = r'A[a-z]{3}C[a-z]{1, 5}'
pattern4 = r'A[a-z]{4}C[a-z]{1, 4}'
pattern5 = r'A[a-z]{5}C[a-z]{1, 3}'
pattern6 = r'A[a-z]{6}C[a-z]{1, 2}'
pattern7 = r'A[a-z]{7}C[a-z]{1}'

if (re.match(pattern1, S)) or (re.match(pattern2, S)) or (re.match(pattern3, S)) or (re.match(pattern4, S)) \
        or (re.match(pattern5, S)) or (re.match(pattern6, S)) or (re.match(pattern7, S)):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
from sys import stdin
import re

S = stdin.readline().rstrip()

pattern1 = r'A[a-z]C[a-z]{1, 7}'
pattern2 = r'A[a-z]{2}C[a-z]{1, 6}'
pattern3 = r'A[a-z]{3}C[a-z]{1, 5}'
pattern4 = r'A[a-z]{4}C[a-z]{1, 4}'
pattern5 = r'A[a-z]{4}C[a-z]{1, 3}'
pattern6 = r'A[a-z]{4}C[a-z]{1, 2}'
pattern7 = r'A[a-z]{4}C[a-z]{1}'

if (re.match(pattern1, S)) or (re.match(pattern2, S)) or (re.match(pattern3, S)) or (re.match(pattern4, S)) \
        or (re.match(pattern5, S)) or (re.match(pattern6, S)) or (re.match(pattern7, S)):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
from sys import stdin
import re

S = stdin.readline().rstrip()

pattern1 = r'A.C[a-z]{1, 7}'
pattern2 = r'A[a-z]{2}C[a-z]{1, 6}'
pattern3 = r'A[a-z]{3}C[a-z]{1, 5}'
pattern4 = r'A[a-z]{4}C[a-z]{1, 4}'
pattern5 = r'A[a-z]{4}C[a-z]{1, 3}'
pattern6 = r'A[a-z]{4}C[a-z]{1, 2}'
pattern7 = r'A[a-z]{4}C[a-z]{1}'

if (re.match(pattern1, S)) or (re.match(pattern2, S)) or (re.match(pattern3, S)) or (re.match(pattern4, S)) \
        or (re.match(pattern5, S)) or (re.match(pattern6, S)) or (re.match(pattern7, S)):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
from sys import stdin
import re

S = stdin.readline().rstrip()

pattern1 = r'A.C[a-z]{4}'
pattern2 = r'A[a-z]{2}C[a-z]{3}'
pattern3 = r'A[a-z]{3}C[a-z]{2}'
pattern4 = r'A[a-z]{4}C[a-z]{1}'

if (re.match(pattern1, S)) or (re.match(pattern2, S)) or (re.match(pattern3, S)) or (re.match(pattern4, S)):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
S = input()
flag = True
if S[0] != 'A' or S[2:-2].count('C') != 1 or S[1].lower() != S[1] or S[-1].lower() != S[-1]:
  flag = False
for i in range(2,len(S)-1):
  if S[i] != 'C' and S[i].lower() != S[i]:
    flag = False
print('AC' if flag else 'WA')

Submission status: Wrong Answer

Solution code:
S = input()
flag = True
if S[0] != 'A' or S[2:-2].count('C') != 1 or S[1].lower() != S[1] or S[-1].lower() != S[-1]:
  flag = False
for s in S[2:-1]:
  if s != 'C' and s.lower() != s:
    flag = False
print('AC' if flag else 'WA')

Submission status: Wrong Answer

Solution code:
S = input()
flag = True
if S[0] != 'A' or S[2:-2].count('C') != 1 or S[1].lower() != S[1] or S[-1].lower() != S[-1]:
  flag = False
for s in S[2:-2]:
  if s != 'C' and s.lower() != s:
    flag = False
print('AC' if flag else 'WA')

Submission status: Wrong Answer

Solution code:
S = input()
flag = True
if S[0] != 'A' or S[2:-2].count('C') != 1 or S[1].lower() != S[1]:
  flag = False
for s in S[2:]:
  if s != 'C' and s.lower() != s:
    flag = False
print('AC' if flag else 'WA')

Submission status: Wrong Answer

Solution code:
import sys
import re

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

Submission status: Wrong Answer

Solution code:
import sys
import re

s = input()
check = len(s)
if ('A' in s[0]) and ('C' in s[2:len(s)-1]):
    if s.count('C') == 1:
        next_s = re.sub(r'[C]', '', s)
        if next_s[2:len(next_s)].islower():
            print('AC')
            sys.exit()
print('WA')

Submission status: Wrong Answer

Solution code:
import sys
import re

s = 'AtCoder'
check = len(s)
if ('A' in s[0]) and ('C' in s[2:len(s)-1]):
    if s.count('C') == 1:
        next_s = re.sub(r'[C]', '', s)
        if next_s[2:len(next_s)].islower():
            print('AC')
            sys.exit()
print('WA')

Submission status: Wrong Answer

Solution code:
S = input()
lead = S[0]
sub = S[2:-1]
C = sub.count('C')
sub_rep = sub.replace('C','a')
if lead == 'A' and C == 1:
  for i in range(len(S)):
    if i == 'A' or 'C':
      pass
    else:
      if i.islower():
        pass
      else:
        print('WA')
        exit()
  print('AC')
  exit()
else:
  print('WA')

Submission status: Wrong Answer

Solution code:
import sys
x=input()
if (x[0:1]=='A' ) :
    pass
else:
    print('WA')
    sys.exit()

if 'C' in x[2:len(x)-1]:
    pass
else:
    print('WA')
    sys.exit()

y=x.replace('C','c')
y=y.replace('A','a')

if str.islower(y):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
import sys
x=input()
if (x[0:1]=='A' ) :
    pass
else:
    print('WA')
    exit

if 'C' in x[2:len(x)-1]:
    pass
else:
    print('WA')
    exit

y=x.replace('C','c')
y=y.replace('A','a')

if str.islower(y):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
x=input()
if (x[0:1]=='A' ) :
    pass
else:
    print('WA')

if 'C' in x[2:len(x)-1]:
    pass
else:
    print('WA')

y=x.replace('C','c')
y=y.replace('A','a')

if str.islower(y):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
s=input()
ans=0
d=len(s)
if s[0]=="A":
 ans+=1
if (s[2],s[d-2]).count("C")==1:
 ans+=1
if s.count("A")==1:
 ans+=1
if s.count("B")==0:
 ans+=1
if s.count("C")==1:
 ans+=1
if s.count("D")==0:
 ans+=1
if s.count("E")==0:
 ans+=1
if s.count("F")==0:
 ans+=1
if s.count("G")==0:
 ans+=1
if s.count("H")==0:
 ans+=1
if s.count("I")==0:
 ans+=1
if s.count("J")==0:
 ans+=1
if s.count("K")==0:
 ans+=1
if s.count("L")==0:
 ans+=1
if s.count("M")==0:
 ans+=1
if s.count("N")==0:
 ans+=1
if s.count("O")==0:
 ans+=1
if s.count("P")==0:
 ans+=1
if s.count("Q")==0:
 ans+=1
if s.count("R")==0:
 ans+=1
if s.count("S")==0:
 ans+=1
if s.count("T")==0:
 ans+=1
if s.count("U")==0:
 ans+=1
if s.count("V")==0:
 ans+=1
if s.count("W")==0:
 ans+=1
if s.count("X")==0:
 ans+=1
if s.count("Y")==0:
 ans+=1
if s.count("Z")==0:
 ans+=1
if ans==28:
 print("AC")
else:
 print("WA")

Submission status: Wrong Answer

Solution code:
s=input()
ans=0
if s[0]=="A":
 ans+=1
if (s[2],s[-2]).count("C")==1:
 ans+=1
if s.count("A")==1:
 ans+=1
if s.count("B")==0:
 ans+=1
if s.count("C")==1:
 ans+=1
if s.count("D")==0:
 ans+=1
if s.count("E")==0:
 ans+=1
if s.count("F")==0:
 ans+=1
if s.count("G")==0:
 ans+=1
if s.count("H")==0:
 ans+=1
if s.count("I")==0:
 ans+=1
if s.count("J")==0:
 ans+=1
if s.count("K")==0:
 ans+=1
if s.count("L")==0:
 ans+=1
if s.count("M")==0:
 ans+=1
if s.count("N")==0:
 ans+=1
if s.count("O")==0:
 ans+=1
if s.count("P")==0:
 ans+=1
if s.count("Q")==0:
 ans+=1
if s.count("R")==0:
 ans+=1
if s.count("S")==0:
 ans+=1
if s.count("T")==0:
 ans+=1
if s.count("U")==0:
 ans+=1
if s.count("V")==0:
 ans+=1
if s.count("W")==0:
 ans+=1
if s.count("X")==0:
 ans+=1
if s.count("Y")==0:
 ans+=1
if s.count("Z")==0:
 ans+=1
if ans==28:
 print("AC")
else:
 print("WA")

Submission status: Wrong Answer

Solution code:
s=input()
ans=0
if s[0]=="A":
 ans+=1
if (s[2],s[-1]).count("C")==1:
 ans+=1
if s.count("A")==1:
 ans+=1
if s.count("B")==0:
 ans+=1
if s.count("C")==1:
 ans+=1
if s.count("D")==0:
 ans+=1
if s.count("E")==0:
 ans+=1
if s.count("F")==0:
 ans+=1
if s.count("G")==0:
 ans+=1
if s.count("H")==0:
 ans+=1
if s.count("I")==0:
 ans+=1
if s.count("J")==0:
 ans+=1
if s.count("K")==0:
 ans+=1
if s.count("L")==0:
 ans+=1
if s.count("M")==0:
 ans+=1
if s.count("N")==0:
 ans+=1
if s.count("O")==0:
 ans+=1
if s.count("P")==0:
 ans+=1
if s.count("Q")==0:
 ans+=1
if s.count("R")==0:
 ans+=1
if s.count("S")==0:
 ans+=1
if s.count("T")==0:
 ans+=1
if s.count("U")==0:
 ans+=1
if s.count("V")==0:
 ans+=1
if s.count("W")==0:
 ans+=1
if s.count("X")==0:
 ans+=1
if s.count("Y")==0:
 ans+=1
if s.count("Z")==0:
 ans+=1
if ans==28:
 print("AC")
else:
 print("WA")

Submission status: Wrong Answer

Solution code:
input_a = input()
if input_a[0] != 'A':
    print("WA")
elif input_a.count('C')==0:
    print("WA")
elif input_a.count('C')>1:
    print("WA")
elif input_a.index('C') ==1:
    print("WA")
elif input_a.index('C') ==len(input_a)-1:
    print('WA')
elif input_a.count('C') ==1:
    if input_a.strip("A").strip('C').islower():
        print('AC')
    else:
        print('WA')

Submission status: Wrong Answer

Solution code:
s = input()

noAC = s.replace('A', '').replace('C', '')
content = s[2:len(s)-1]

if s[0] != 'A' or (not('C' in content)) or (not noAC.islower()):
  print('WA')
else:
  print('AC')

Submission status: Wrong Answer

Solution code:
s = input()

noAC = s.replace('A', '').replace('C', '')
content = s[2:len(s)-1]

if s[0] != 'A' or (not('C' in content)) or (not noAC.islower()):
  print('WA')
else:
  print('SC')

Submission status: Wrong Answer

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

else:print("WA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
A_list =["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
ans_C = 0
ans_Big = 0
if s[0] != "A":
  print("WA")
else:
  for i in range(2,(len(s)-1)):
    if s[i] == "C":
       ans_C += 1
    else:
       ans_C += 0
  for j in range(len(s)):
    if s[j] in A_list:
      ans_Big += 1
    else:
      ans_Big += 0
  if ans_C == 1 and ans_Big ==0:
    print("AC")
  else:
    print("WA")

Submission status: Wrong Answer

Solution code:
s = input()
A_list =["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
ans_C = 0
ans_Big = 0
if s[0] != "A":
  print("WA")
else:
  for i in range(2,(len(s)-1)):
    if s[i] == "C":
      ans_C += 1
    else:
      ans_C += 0
  for j in range(len(s)):
    if s[j] in A_list:
      ans_Big += 1
    else:
      ans_Big += 0
  if ans_C == 1 and ans_Big == 0:
    print("AC")
  else:
    print("WA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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