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:
s=list(input())
if s[0]=='A':
    if 'C' in s[2:len(s)-1]:
        s.sort()
        t=''.join(s[2:len(s)-1])
        if t.islower():
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = [i for i in input()]
judge = 0
if x[0] == "A" :
  judge += 1
  if x[2:-1].count("C") == 1:
    judge += 1
    x.remove("A")
    x.remove("C")
    if "".join(x).islower():
      judge += 1
if judge == 3:
  print("AC")
else:
  print("WA")

Submission status: Accepted

Solution code:
s=list(input())
#print(s)
if s[0] != "A":
  print("WA");exit()
#print(s[2:-1])
if "C" not in s[2:-1]:
  print("WA");exit()
s_remove=s.remove
s_remove("A");s_remove("C")
#print(s)
s="".join(s)
#print(s)
if s.islower():
  print("AC")
else:
  print("WA")

Submission status: Accepted

Solution code:
s = list(x for x in input())
if s[0] != 'A':
  print('WA')
else:
  if 'C' not in s[2:-1]:
    print('WA')
  else:
    count = 0
    for i in range(len(s)):
      if s[i].isupper():
        count += 1
    if count != 2:
      print('WA')
    else:
      print('AC')

Submission status: Accepted

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')


S=input()

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

Submission status: Accepted

Solution code:
S = input()

cnt = 0

if S[0] != 'A':
    print('WA')
else:
    for i, s in enumerate(S[2:-1]):
        if s == 'C':
            cnt += 1
            c_idx = i
    if cnt == 1:
        c_idx += 2
        part_str = S[1:c_idx] + S[c_idx+1:]
        if part_str.islower():
            print('AC')
        else:
            print('WA')
    else:
        print('WA')

Submission status: Accepted

Solution code:
n = input()

if n[0] == 'A':
    for i in range(len(n)-3):
        ##print(i,n[i+2],n[1:i+2],n[i+3::])
        if n[i+2] == 'C' and (n[1:i+2]+n[i+3::]).islower():
            print('AC')
            exit()

print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
N=len(S)

flag1=0
flag2=0
flag3=0

num_l=0
for i in range(N):
  if S[i].islower():
    num_l+=1
#print(num_l)
if num_l==N-2:
  flag1=1
  
if S[0]=="A":
  flag2=1

for i in range(2,N-1):
  if S[i]=="C":
    flag3=1

#print(flag1,flag2,flag3)
print("AC" if flag1*flag2*flag3==1 else "WA")

Submission status: Accepted

Solution code:
S = input()
if S[0] != 'A':
  print('WA')
  exit()
count = 0
if len(S) < 4:
  print('WA')
  exit()
for i in range(len(S) - 3):
  if S[i+2] == 'C':
    count += 1
  elif S[i+2].islower():
    continue
  else:
    print('WA')
    exit()
if S[1].isupper() or S[-1].isupper():
  print('WA')
  exit()
if count == 1:
  print('AC')
  exit()
print('WA')

Submission status: Accepted

Solution code:
s=input()
n=len(s)
if s[0]!='A' or 'C' not in s[2:n-1] or s.count('C')!=1:
  print('WA')
else:
  s=s.replace('A','')
  s=s.replace('C','')
  if s.islower()==1:
    print('AC')
  else:
    print('WA')

Submission status: Accepted

Solution code:
S = input()

res = "AC"
if S[0] != "A" or S.count("C") != 1:
    res = "WA"

if "C" not in S[2:-1]:
    res = "WA"

if res == "AC":
    for s in S[1:]:
        if s != "C" and s != s.lower():
            res = "WA"
            break
print(res)

Submission status: Accepted

Solution code:
a = input()

if a[0]=='A' and 'C' in a[2:-1] and sum([i.isupper() for i in a])==2:
  print("AC")
  exit()
print("WA")

Submission status: Accepted

Solution code:
import re

S = input()
if re.search(r'^A[a-z][a-z]*C[a-z]*[a-z]$', S):
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = list(input())
tru = 0
Ccount = 0
Lcount = 0
if s[0] != "A":
         tru = 1
for i in range(2,(len(s)-1)):
         if s[i] == "C":
                  Ccount += 1
if Ccount != 1:
         tru = 1
for j in range(len(s)):
         if s[j].isupper():
                  Lcount +=1
if Lcount != 2:
         tru = 1
if tru == 1:
         print("WA")
else:
         print("AC")

Submission status: Accepted

Solution code:
# ABC104b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

s = input()[:-1]
#print(s.count('C', 2, -1))
if (s[0] != 'A' or s.count('C', 2, -1) != 1):
    print('WA')
    # print('hi')
    exit()
cPos = s.find('C', 2, -1)
if (s[1:cPos].islower() and s[cPos + 1:].islower()):
    # print('hi')
    print('AC')
    exit()
print('WA')

Submission status: Accepted

Solution code:
S = input()
if S[0] == "A" and (S[2: -1].count("C") == 1):
  for c in S:
    if c != "A" and c != "C" and c.isupper():
      print("WA")
      exit(0)
  print("AC")
else:
  print("WA")

Submission status: Accepted

Solution code:
S=input()
N=len(S)

ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ"

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

c=0
idx=0
for i in range(2,N-1):
    if S[i]=="C":
        c+=1
        idx=i

if c!=1:
    print("WA")
    exit()

for i in range(1,N):
    if not i ==idx:
        if S[i] in ABC:
            print("WA")
            exit()

print("AC")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def check_small(string):
    if string in 'abcdefghijklmnopqrstuvwxyz':
        return True
    else:
        return False

s = input()
if s[0] != 'A':
    print('WA')
    sys.exit()
if check_small(s[-1]) == False or check_small(s[1]) == False:
    print('WA')
    sys.exit()
count = 0
for si in s[2:]:
        if si == 'C':
            count += 1
        elif check_small(si) == False:
            print('WA')
            sys.exit()
print('AC' if count == 1 else 'WA')

Submission status: Accepted

Solution code:
s = input()
n = len(s)
if s[0] == 'A' and s[2:n-1].count('C') == 1:
  s = s.replace('A','')
  s = s.replace('C','')
  if s == s.lower():
    print('AC')
    exit()
print('WA')

Submission status: Accepted

Solution code:
def valid(s):
    if s[0] != 'A':
        return False
    if s[2:-1].count('C') != 1:
        return False

    lowercase = sum(1 for ch in s if ch.islower())
    return lowercase == len(s) - 2


print("AC" if valid(input()) else "WA")

Submission status: Accepted

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

Submission status: Accepted

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

ok = s[0] == 'A' and s[2:-1].count('C') == 1
if ok:
    for i, c in enumerate(s):
        if i == 0:
            continue
        if 2 <= i < len(s) - 1 and c == 'C':
            continue
        if c != c.lower():
            ok = False

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

Submission status: Accepted

Solution code:
# B - AcCepted
S = str(input())
count = 0
if S[0] == 'A':
    for i in range(2,len(S)-1):
        if S[i] == 'C':
            count += 1
        else:
            pass

    if count == 1:
        S_1 = set(S)
        S_1.remove('A')
        S_1.remove('C')
        if str(S_1).islower() :
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = list(input())
if s[0] == "A":
    c = 0
    for i in range(2,len(s)-1):
        if s[i] == "C":
            c += 1
    if c == 1:
        s.remove("A")
        s.remove("C")
        c2 = 0
        for i in s:
            if i.islower():
                c2 += 1
        if c2 == len(s):
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()
f1 = False
f2 = False
f3 = False
if s[0] == 'A':
    f1 = True
f2_index = None
for i in range(len(s)):
    if s[i] == 'C' and i >= 2 and i <= len(s) - 2:
        f2 = True
        f2_index = i
        break
for j in range(len(s)):
    if j != 0 and j != f2_index:
        if s[j].islower():
            f3 = True
        else:
            f3 = False
            break
if f1 and f2 and f3:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
S = input()
if S[0] != 'A':
    print('WA')
    exit()
elif S[2:-1:].count('C') != 1:
    print('WA')
    exit()
S2 = S.replace('A','',1).replace('C','',1)
if S2.islower():
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
import sys
s = input()

if s[0] == 'A':
    if 'C' in s[2:-1]:
        cidx = s.find('C')
        for i in range(1, len(s)):
            if i != cidx:
                if s[i].isupper():
                    print('WA')
                    sys.exit()
        print('AC')
        sys.exit()
    else:
        print('WA')
        sys.exit()
else:
    print('WA')
    sys.exit()

print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]
S = list(input())

if S[0]=='A':
    if S[2:-1].count('C')==1:
        for s in S[1:]:
            if s=='C':
                continue
            else:
                if not s.islower():
                    break
        else:
            print('AC')
            exit()
print('WA')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(str(input()))
a = n[2:]
b = a[:-1]
count = 0
cindex = []
for i in range(len(b)):
    if b[i] == "C":
        count += 1
        cindex.append(i)
if n[0] != "A" or count != 1:
    print("WA")
else:
    del n[0]
    del n[cindex[0] + 1]
    m = "".join(n)
    if m.islower():
        print("AC")
    else:
        print("WA")

Submission status: Accepted

Solution code:
S = list(input())
l = len(S)
if S[0]=="A" and "C" in S[2:l-1]:
  S.remove("A")
  S.remove("C")
  S = "".join(S)
  if S.islower():
    print("AC")
  else:
    print("WA")
else:
  print("WA")

Submission status: Accepted

Solution code:
S = input()
f = False
n = len(S)

f = True
ff = False

if S[0] != "A":
  f = False
if S[1].isupper():
  f = False
for i in range(2,n-1):
  if S[i] == "C" and ff == False:
    ff = True
  elif S[i].isupper():
    f = False
if S[-1].isupper():
  f = False

if f == False or ff == False:
  print("WA")
else:
  print("AC")

Submission status: Accepted

Solution code:
import sys
s = list(input())
if s[0] == 'A':
  del s[0]
  if s[1:-1].count('C') == 1:
      s.remove('C')
      for i in range(len(s)):
          if s[i].isupper():
              print('WA')
              sys.exit()
      print('AC')
  else:
      print('WA')
else:
    print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections
s=input()
c = collections.Counter(s[2:-1])
if s[0]=="A" and c["C"] == 1:
    for item in s:
        if item.isupper() == True and item!="A" and item!="C":
            print("WA")
            exit()
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()
if s[0]=='A' and s[2:-1].count('C')==1 and s.translate(str.maketrans({'A':'', 'C':''})).islower():
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = list(input())
ans ="AC"
if S[0]!="A":
    ans ="WA"
if S.count("C") !=1:
    ans ="WA"
if S[2:-1].count("C")!=1:
    ans ="WA"
if S[0]==("A"):
    del S[0]
if S.count("C")>0:
    S.remove("C")
S = str(S)
for i in range(len(S)):
    if (S[i]).isupper():
        ans = "WA"
print(ans)

Submission status: Accepted

Solution code:
S = input()

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

count2 = 0
for i in S:
    if i == i.upper():
        count2 += 1
if count2 != 2:
    flag = 1
    
if flag == 0:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
S = input()
count = 0

if S[0] == 'A':
    count += 1
if S[2:-1].count("C") == 1:
    count += 1
S = S.replace("C", "")
S=S[1:]
if S.islower():
    count += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
if S[0] == 'A' and S[2:-1].count('C') == 1 and S[1].islower() and S[2:].replace('C', 'c').islower():
    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()

i = S[2:-1].find('C')

if i >= 0:
    S = S[1:2 + i] + S[2 + i + 1:]
    if S.islower():
        print('AC')
        exit()
    else:
        print('WA')
        exit()
else:
    print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

index = 0
cnt = 0
for i in range(2,len(S)-1):
    if S[i] == "C":
        cnt += 1
        index = i
if cnt != 1:
    print("WA")
    exit()

for i in range(1,len(S)):
    if i == index:
        pass
    elif S[i].islower() != True:
        print("WA")
        exit()

print("AC")

Submission status: Accepted

Solution code:
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

S = IS()
if S[0] == "A" and S.count("C") == 1 and S[-1] != "C":
    if S[1].islower() == True:
        if S[S.index("C")+1:].islower() == True:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
flag = 0
cnt = 0
for i in range(ord("A"),ord("Z")+1):
    cnt += s.count(chr(i))

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

Submission status: Accepted

Solution code:
s = input()

import re

a = s[0] == "A"
b = len(re.findall("C", s[2:-1])) == 1
c = len(re.findall(r"[a-z]", s)) == len(s) - 2

if a and b and c:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
S=input()
ans=True
if S[0]!="A":
  ans=False

if S[2:-1].count("C")!=1:
  ans=False

if (S.replace("A","a").replace("C","c"))!=S.lower():
  ans=False

print(("WA","AC")[ans])

Submission status: Accepted

Solution code:
S = list(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
ans = 'AC'

if S[0] != 'A':
  ans = 'WA'
if S[2:len(S)-1].count('C') != 1:
  ans = 'WA'

if sum(1 for c in S if c.isupper()) != 2:
  ans = 'WA'
print(ans)

Submission status: Accepted

Solution code:
# ABC104 B-AcCepted
S = input()

c1 = False
c2 = False
c3 = False

if S[0]=="A":
    c1 = True

if S.count("C",2,-1) == 1:
    c2 = True

S = S.replace("A","").replace("C","")

if S.islower():
    c3 = True

if c1 == True and c2 == True and c3 == True:
    print("AC")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()

if s[0] != "A":
  print("WA")
  exit()
  
if "C" not in s[2:-1]:
  print("WA")
  exit()
else:
  l = list(s[2:-1])
  l.remove("C")
  if "C" in l:
    print("WA")
    exit()

lst = list(s)
lst.remove("A")
lst.remove("C")
a = "".join(lst)

if a == a.lower():
  print("AC")
else:
  print("WA")

Submission status: Accepted

Solution code:
S = list(input())

Flag = False
if S[0] == "A" and S[2:-1].count("C") == 1:
    S.remove("A")
    S.remove("C")
    string = "".join(S)
    if string.islower() or string.isupper():
        Flag = True

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

Submission status: Accepted

Solution code:
s=str(input())
if s[0]!='A':
    print('WA')
else:
    c=s.count('C',2,len(s)-1)
    if c!=1:
        print('WA')
    else:
       d=s.find('C',2,len(s)-1)
       s=s[1:d]+s[d+1:]
       ss=s.lower()
       #print(s,ss)
       print('AC' if s==ss else 'WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
cnt = 0
for x in s:
    if x.isupper():
        cnt += 1

if (s[0] == "A") and ("C" in s[2:-1]) and (cnt == 2):
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()

ok = True
if s[0] != "A" or s[-1] == "C" or s[1] == "C":
    ok = False
count = 0
for i in range(1, len(s)):
    if s[i] == "C" and i != len(s)-1:
        count += 1
    elif s[i] not in "abcdefghijklmnopqrstuvwxyz":
        ok = False
        break
if count != 1:
    ok = False

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

Submission status: Accepted

Solution code:
s = input()
flag = True
if s[0]!='A': flag=False
if s[2:-1].count('C')!=1: flag=False
if flag:
    l = list(s[2:-1])
    l.remove('C')
    s = s[1] + ''.join(l) + s[-1]
    if s!=s.lower(): flag=False
print("AC" if flag else "WA")

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

alpha2num = lambda c: ord(c) - ord('a') + 1

s = input()
ans = "WA"
if s[0] == "A" and s.count("C") == 1:
    if 2 <= s.index("C") <= len(s) - 2:
        for i in range(1, len(s)):
            if i == s.index("C"):
                continue
            elif 1 <= alpha2num(s[i]) <= 26:
                ans = "AC"
            else:
                ans = "WA"
                break
print(ans)

Submission status: Accepted

Solution code:
import sys

s = input()
if s[0] == 'A':
    if 'C' in s[2:-1]:
        index = s[2:-1].index('C') + 2
        news = s[1:index] + s[index+1:]
        if news == news.lower():
            print('AC')
            sys.exit()
print("WA")

Submission status: Accepted

Solution code:
import re

def check1(s):
    if s[0] == "A":
        return 1
    else:
        return 0

def check2(s):
	temp = s.lstrip(s[0]+s[1]).rstrip(s[-1]) 
	if temp.count("C") == 1:
		return 1
	else:
		return 0

def check3(s):
	if re.sub("[AC]","",s).islower() == True:
		return 1
	else:
		return 0

s = str(input())

if check1(s) + check2(s) + check3(s) == 3:
	print("AC")
else:
	print("WA")

Submission status: Accepted

Solution code:
S = input()

flag = True
if S[0] != "A":flag = False
if S[2:-1].count("C") != 1:flag = False
if flag:
    ind = S[2:-1].index("C") + 2
    print("AC") if (S[1:ind] + S[ind+1:]).islower() else print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

S = input()

if S[0] == 'A':
    if S[2:-1].count('C') == 1:
        tmp = S[1:].replace('C', '')
        if tmp.islower() or tmp.isupper():
            print('AC')
            exit()

print('WA')

Submission status: Accepted

Solution code:
s=input()

num=0
if s[0]=='A':
  if 'C' in s[2:-1]:
    tmp=s[1:].replace('C','c',1)
    if tmp.islower():
      print('AC')
    else:
      print('WA')
  else:
    print('WA')
else:
  print('WA')

Submission status: Accepted

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: Accepted

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: Accepted

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

Submission status: Accepted

Solution code:
s = input()
ans ='AC'
if s[0]!='A':
  ans = 'WA'

if s[2:-1].count('C')!=1 or s.count('C')>=2:
  ans = 'WA'
  
nc = []  
for c in s[1:]:
  if c!= 'C':
    nc.append(c)
if not ''.join(nc).islower():
  ans = 'WA'

print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(200000)
input = sys.stdin.readline

S = input().strip()

f = True

c = 0
for i in range(len(S)):
    if i == 0:
        if S[i] != "A":
            f = False
            break
        continue

    if i >= 2 and i <= len(S) - 2:
        if S[i] == "C":
            c += 1
        continue

    if S[i].lower() != S[i]:
        f = False
        break

if f and c == 1:
    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()

if (S[1:S.find("C")] + S[S.find("C")+1:]).islower() == False:
    print("WA")
    exit()

print("AC")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

if s[0] == 'A' and s[2:-1].count('C') == 1:
  for letter in s[1:]:
    if letter != letter.lower() and letter != 'C':
      print('WA')
      break
  else:
    print('AC')
else:
  print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:

S = input()
a = S[0] == "A"
f = 0
for _ in S[2:len(S)-1]:
    if _ == "C":
        f+=1
if f == 1:
    b = True
else:
    b = False

if S.replace("A", "").replace("C","").islower():
    c = True
else:
    c = False

if a and b and c:
    print("AC")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())
n=len(s)
ans="AC"
if(s[0]!="A"):
    ans="WA"
else:
    s[0]=s[0].swapcase()
cnt=0
check=0
for i in range(n-3):
    if(s[i+2]=="C"):
        check+=1
        s[i+2]=s[i+2].swapcase()
if(check!=1):
    ans="WA"
if(str.islower(''.join(s))==False):
    ans="WA"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def test():
    s = input()
    a = []
    count = 0
    if s[0] == "A":
        for i in range(2,len(s)-1):
            if s[i] == "C":
                a.append(i)
                count += 1

    s2 = list(s)
    for i in a:
        s2.remove(s[i])

    s3 = "".join(s2[1:])

    if count == 1 and s3.islower():
        print("AC")
    else:
        print("WA")


if __name__ == "__main__":
    test()

Submission status: Accepted

Solution code:
import math
import sys
import queue
from collections import Counter
from itertools import accumulate
from fractions import gcd
from functools import reduce

def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

mod = 1000000007

"""
# 標準入力取得
## 文字列
    = sys.stdin.readline().rstrip()
    = list(sys.stdin.readline().rstrip())

## 数値
    = int(sys.stdin.readline())
    = map(int, sys.stdin.readline().split())
    = list(map(int, sys.stdin.readline().split()))
    = [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

if __name__ == "__main__":
    S = list(sys.stdin.readline().rstrip())
    if S[0] == "A":
        if "C" in S[2:len(S) - 1:]:
            S.remove("A")
            S.remove("C")
            if "".join(S).islower():
                print("AC")
                exit()
    print("WA")

Submission status: Accepted

Solution code:
def main():
    S = input()
    n = len(S)
    if S[0] != "A": return "WA"

    j = None
    for i in range(2, n-1):
        if S[i] == "C":
            if j == None:
                j = i
            else:
                return "WA"
    if j == None: return "WA"
    for i in range(1, n):
        if i != j and not S[i].islower():
            return "WA"
    return "AC"



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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
f = False
C = 0
Upper = 0
for i in range(len(s)):
    if s[0] != "A":
        break
    if s[i].isupper():
        Upper += 1
    if 2 <=i and i<=len(s)-2:
        if s[i] == "C":
            C += 1
if Upper == 2 and C == 1:
    f = True
if f:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = input()
print("AC" if s[0] == 'A' and s[1:].count('C') == 1 and s[2:-1].count('C') == 1 and all(c.islower() or c == 'C' for c in s[1:]) else "WA")

Submission status: Accepted

Solution code:
S=input()
if S[0]=='A':
    if S[2:-1].count('C')==1:
        n=S[2:-1].index('C')+2
        if S[1:n].islower() and S[n+1:].islower():
            print('AC')
            exit()
print('WA')

Submission status: Accepted

Solution code:
s = input()

ret = True
if s[0] != 'A':
	ret = False
if s[2: len(s) -1].count('C') != 1:
	ret = False
if not s.replace('A', 'a').replace('C', 'c').islower():
    ret = False
if (ret):
	print ("AC")
else:
    print ("WA")

Submission status: Accepted

Solution code:
import os, sys, re, math

lines = sys.stdin.readlines()

S = lines[0].strip()

accepted = False
if S[0] == 'A':
    if len(S[2:-1].replace('C', '')) == len(S[2:-1]) - 1:
        if len(re.sub(r'[A-Z]', '', S)) == (len(S) - 2):
            accepted = True
            exit

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

Submission status: Accepted

Solution code:
AC = input()
correct = AC[0] == 'A' and AC.count('A') == 1 and AC[-1] != 'C' and AC[:2].count('C') == 0 and AC[2:-1].count('C') == 1 and AC.replace('A', 'a').replace('C', 'c') == AC.lower()
print('AC' if correct else 'WA')

Submission status: Accepted

Solution code:
import re;print("AWCA"[re.match(r"^A[a-z]+C[a-z]+$",input())==None::2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=list(input())
if S[0]!='A' or S[2:-1].count('C')!=1:print('WA')
else:
    S.remove('A')
    S.remove('C')
    S=sorted(set(S))
    if 'a'<=S[0] and S[-1]<='z':
        print('AC')
    else:
        print('WA')

Submission status: Accepted

Solution code:
S = input()
S = list(S)
flag = True
if S[0] != "A":
    flag = False
flag1 = False
for i in range(2,len(S)-1):
    if S[i] == "C" and flag1:
        flag = False
        
        
    elif S[i] == "C" and not flag1:
        flag1 = True
        S[i] = "c"
if not flag1:
    flag = False
S[0] = "a"
for i in range(len(S)):
    if not S[i].islower():
        flag = False
        
if flag:
    print('AC')
else:
    print('WA')