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 = list(input())
if s[0] == 'A':
  if s[2:-1].count('C') == 1:
    for i in range(1, len(s)):
      if 97 <= ord(s[i]) <= 122:
        print("AC")
      else:
        break
  else:
    print("WA")
else:
  print("WA")

Submission status: Wrong Answer

Solution code:
alf = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
s = input()
if s[0] != 'A':
  print('WA')
  exit()
cnt = 0
pos = 0
for i,c in enumerate(s[2:-2]):
  if c == 'C':
    cnt += 1
    pos = i+2
if cnt != 1:
  print('WA')
  exit()
for i,c in enumerate(s[1:]):
  if i+1 != pos and c in alf:
    print('WA')
    break
else:
  print('AC')

Submission status: Wrong Answer

Solution code:
import sys

s=input()
c_count=0
flag=False


for ss in s:
    if ss.isupper():
        if ss!='A' and ss!='C':
            print('WA')
            sys.exit()

for i in range(2,len(s)-1):
    if s[i]=='C':
        c_count+=1
        if c_count > 1:
            flag=False

if c_count==1:
    flag=True

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

Submission status: Wrong Answer

Solution code:
s = input()

if s[0] != 'A' or s[2:-1].count('C') != 1:
  print('WA')
else:
  for i,c in enumerate(s):
    if i in (0,2):
      continue
    else:
      if not 'a'<=c<='z':
        print('WA')
        break
  else:
    print('AC')

Submission status: Wrong Answer

Solution code:
s = input()

if s[0] != 'A' or s[2] != 'C':
  print('WA')
else:
  for i,c in enumerate(s):
    if i in (0,2):
      continue
    else:
      if not 'a'<=c<='z':
        print('WA')
        break
  else:
    print('AC')

Submission status: Wrong Answer

Solution code:
S=input()
s=""
flag=1
Cflag=1
if not(S[0]=="A"):
    flag=0
else:
    S2=S[2:len(S)-1]
    #print(S)
    for i in range(len(S2)):
        if not(S2[i]=="C"):
            s="".join((s,S2[i]))
        else:
            Cflag=Cflag-1
    if not(Cflag==0):
        flag=0
    if s.islower()==False:
        flag=0
    if (S[1].islower()==False)or(S[len(S)-1].islower()==False):
        flag=0
    #print(s.islower(),Cflag,s,S[1].islower(),S[len(S)-1].islower())

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

Submission status: Wrong Answer

Solution code:
S=input()
s=""
flag=1
Cflag=1
if not(S[0]=="A"):
    flag=0
else:
    S=S[2:len(S)-1]
    #print(S)
    for i in range(len(S)):
        if not(S[i]=="C"):
            s="".join((s,S[i]))
        else:
            Cflag=Cflag-1
    if not(Cflag==0):
        flag=0
    if s.islower()==False:
        flag=0

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

Submission status: Wrong Answer

Solution code:
s=str(input())
can=int(1)

if s[0]!='A':
    can=0

count=int(0)
big=int(0)

for i in range(2,len(s)-2):
    if s[i]=='C':
        count+=1
        big=i

if count!=1:
    can=0

for i in range(1,len(s)):
    if i==big:
        continue

    if s[i].isupper():
        can=0

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

Submission status: Wrong Answer

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

if s[0] == 'A' and s.count('C') == 1 and 'C' in s[2:-2]:
    s = s.lstrip('A')
    s = s.replace('C','')
    if not s.isupper():
        ans = 'AC'

print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
ans = True
count = 0
for i in range(len(s)):
  if s[i].isupper():
    count+=1
if count != 2:
  print('Wa')
  exit()
elif s[2:-1].count('C') != 1 or s[0]!='A' or not s[1].islower():
  print('Wa')
else:
  print('AC')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
moji = input()

if moji[0] == "A":
    print("AC")

elif "C" in moji[2:-1]:
    print("AC")
    
elif moji.islower:
    print("AC")

else:
    print("WA")

Submission status: Wrong Answer

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

if 'A' in s[0] and 'C' in s[2:-2]:
    if s.find('C') != 1 and s.count('C') == 1:
        ans = 'AC'

print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())
ans = 'WA'

if s[0] == 'A' and 'C' in s:
    s.pop(0)
    if len(s) == len(set(s)):
        if s.index('C') != 0 and s.index('C') != len(s) -1:
            s.remove('C')
            mojiretu = ''.join(s)
            if not mojiretu.isupper():
                ans = 'AC'
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
if s[0]=='A':
  s=s.lstrip('A')
else:
  print('WA')
  exit()

if s[1:-2].count('C')==1:
  s=s.replace('C','')
else:
  print('WA')
  exit()
  
if s.islower():
    print('AC')
else:
  print('WA')

Submission status: Wrong Answer

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

if s[0] == "A" and s[2:-1].count("C") == 1:
	for i in s[1:]:
		if i.islower() or i =="C":
			ans = "AC"
			
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

if s[0] == "A":
	if s[2:-1].count("C") == 1:
		for i in s[1:]:
			if i.islower() or i =="C":
				print("AC")
				exit()
print("WA")

Submission status: Wrong Answer

Solution code:
import sys

S = input()

if S[0] == 'A' and S[2:-1].count('C') == 1:
    S.replace('A', 'a', 1).replace('C', 'c', 1)
    if S == S.lower():
        print('AC')
        sys.exit()

print('WA')

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

Solution code:
S = input()

ans = "WA"
if S[0] == "A":
    if S[2:-2].count("C") == 1 and S.count("C") == 1:
        n = len(S)
        for i in range(len(S)):
            if S[i] == "A" or S[i] == "C":
                pass 
            elif S[i].isupper() == True:
                n -= 1
                break
        if n == len(S):
            ans = "AC"

print(ans)

Submission status: Wrong Answer

Solution code:
import re
s = input()
cnt = 0
if (s[2:-1].count('C') != 1):
    print('WA')
    exit(0)
for i in range(len(s)):
    if (s[i] >= 'A' and s[i] <= 'Z'):
        cnt += 1
        if (cnt >= 3):
            print('WA')
            exit(0)
print('AC')

Submission status: Wrong Answer

Solution code:
import re
s = input()
cnt = 0
if (s[2:-2].count('C') != 1):
    print('WA')
    exit(0)
for i in range(len(s)):
    if (s[i] >= 'A' and s[i] <= 'Z'):
        cnt += 1
        if (cnt >= 3):
            print('WA')
            exit(0)
print('AC')

Submission status: Wrong Answer

Solution code:
s = input()
cnt = 0
if (s[2:-2].count('C') != 1):
    print('WA')
    exit(0)
for i in range(len(s)):
    if (s[i] >= 'A' and s[i] <= 'Z'):
        cnt += 1
        if (cnt >= 3):
            print('WA')
            exit(0)
print('AC')

Submission status: Wrong Answer

Solution code:
S = input()

ans = "WA"
if S[0] == "A":
    if S[2:-2].count("C") == 1 and S.count("C") == 1:
        n = len(S)
        for i in range(len(S)):
            if S[i] == "A" or S[i] == "C":
                n -= 1
        if n == len(S) - 2:
            ans = "AC"

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

ans = "WA"
if S[0] == "A":
    if S[2:-2].count("C") == 1 and S.count("C") == 1:
        n = len(S)
        for i in range(len(S)):
            if S[i] == "A" or S[i] == "C":
                n -= 1
                if n == len(S) - 2:
                    ans = "AC"
                    break

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

ans = "WA"

if S[0] != "A":
  print(ans)
  
else:
  if S[2:len(S) - 1].count("C") != 1:
    print(ans)
  else:
    s = S.index("C")
    SS = S[1:s] + S[s + 1:]
    print(SS)
    if SS.islower() == False:
      print(ans)
    else:
      print("AC")

Submission status: Wrong Answer

Solution code:
import re

S = input()

ans = "WA"

if S[0] != "A":
  ans = "WA"
  print(ans)
else:
  if S[2:len(S) - 1].count("C") != 1:
    print(ans)
  else:
    s = S.index("C")
    SS = S[2:s] + S[s + 1:]
    if SS.islower() == False:
      print(ans)
    else:
      print("AC")

Submission status: Wrong Answer

Solution code:
S = input()

ans = "WA"

if S[0] != "A":
  ans = "WA"
  print(ans)
else:
  if S[1:len(S) - 1].count("C") != 1:
    print(ans)
  else:
    s = S.index("C")
    SS = S[1:s] + S[s + 1:]
    if SS.islower() == False:
      print(ans)
    else:
      print("AC")

Submission status: Wrong Answer

Solution code:
S = input()


def judge(sent):
    if sent[0] != 'A':
        return False
    if sum(['C' in s for s in sent[2:-1]]) != 1:
        return False
    if any([s.isupper() for s in sent[1] + sent[3:]]):
        return False
    return True


if judge(S):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
S = list(input().strip())
flag = False

if S[0] == "A" and "C" in S[2:-1]:
    count = 0
    for s in S:
        if s < "D" and s != "B":
            count += 1
    if count == 2:
        flag = True
if flag:
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
S = list(input().strip())
flag = False
if S[0] == "A" and "C" in S[2:-1]:
    count = 0
    for s in S:
        if s < "D":
            count += 1
    if count == 2:
        flag = True
if flag:
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
A = list(input())
L = len(A)

ans = 'WA'
flag = 0
f = 0
j = 0

if A[0] == 'A':
    if A[0].isupper():
        flag = flag + 1
#print(flag)
count = 0
i=2
while(1):
    if A[i] == 'C':
        if A[i].isupper():
            count = count + 1
    i = i + 1
    if (L-2-i < 0):
        break
#print(count)
if count == 1:
    flag = flag + 1
#print(flag)
count = 0
for i in range(1,L):
    #print(A[i].isupper())
    if A[i].isupper():
        count = count + 1
print(count)
if count == 1:
    flag = flag + 1
#print(flag)
if flag == 3:
    ans = 'AC'

print(ans)

Submission status: Wrong Answer

Solution code:
A = list(input())
L = len(A)

ans = 'WA'
flag = 0
f = 0
j = 0

if A[0] == 'A':
    if A[0].isupper():
        flag = flag + 1
#print(flag)
count = 0
i=2
while(1):
    if A[i] == 'C':
        if A[i].isupper():
            count = count + 1
    i = i + 1
    if (L-2-i < 0):
        break
#print(count)
if count == 1:
    flag = flag + 1
#print(flag)
count = 0
for i in range(1,L-1):
    #print(A[i].isupper())
    if A[i].isupper():
        count = count + 1
#print(count)
if count == 1:
    flag = flag + 1
#print(flag)
if flag == 3:
    ans = 'AC'

print(ans)

Submission status: Wrong Answer

Solution code:
A = list(input())
L = len(A)

ans = 'WA'
flag = 0
f = 0
j = 0

if A[0] == 'A':
    if A[0].isupper():
        flag = flag + 1
print(flag)
count = 0
i=2
while(1):
    if A[i] == 'C':
        if A[i].isupper():
            count = count + 1
    i = i + 1
    if (L-2-i < 0):
        break
print(count)
if count == 1:
    flag = flag + 1
print(flag)
count = 0
for i in range(1,L-1):
    #print(A[i].isupper())
    if A[i].isupper():
        count = count + 1
#print(count)
if count == 1:
    flag = flag + 1
print(flag)
if flag == 3:
    ans = 'AC'

print(ans)

Submission status: Wrong Answer

Solution code:
A = list(input())
L = len(A)

ans = 'WA'
flag = 0
f = 0
j = 0

if A[0] == 'A':
    if A[0].isupper():
        flag = flag + 1
#print(flag)
count = 0
for i in range(2,L-2):
    if A[i] == 'C':
        if A[i].isupper():
            count = count + 1
           
#print(j)
if count == 1:
    flag = flag + 1
#print(flag)
count = 0
for i in range(1,L-1):
    #print(A[i].isupper())
    if A[i].isupper():
        count = count + 1
#print(count)
if count == 1:
    flag = flag + 1
#print(flag)
if flag == 3:
    ans = 'AC'

print(ans)

Submission status: Wrong Answer

Solution code:
A = list(input())
L = len(A)

ans = 'WA'
flag = 0
f = 0
j = 0

if A[0] == 'A':
    if A[0].isupper():
        flag = flag + 1
#print(flag)
count = 0
for i in range(2,L-2):
    if A[i] == 'C':
        if A[i].isupper():
            count = count + 1
           
#print(j)
if count == 1:
    flag = flag + 1
#print(flag)
count = 0
for i in range(1,L-1):
    print(A[i].isupper())
    if A[i].isupper():
        count = count + 1
#print(count)
if count == 1:
    flag = flag + 1
#print(flag)
if flag == 3:
    ans = 'AC'

print(ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter
s = input()
fist = s.replace('A', '').replace('C', '')

if not fist.islower():
    print('WA')
else:
    seco = s[2:-2]
    cnt = Counter(seco)
    if not cnt['C'] == 1:
        print('WA')
    else:
        if s[0] == 'A':
            print('AC')
        else:
            print('WA')

Submission status: Wrong Answer

Solution code:
s = list(input())

ans = 'AC'
if s[0] != 'A':
    ans = 'WA'
else:  
    s[0] = 'a'

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

wk = ['a' if i == 'C' else i for i in s]
if "".join(wk).isupper():
    ans = 'WA'

print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())

ans = 'AC'
if s[0] != 'A':
    ans = 'WA'
else:  
    s[0] = 'a'

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

wk = ['x' if i == 'C' else i for i in s]
if "".join(wk).isupper():
    ans = 'WA'

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
count = 0

for i in range(len(s) - 1):
    if s[i].isupper():
        count += 1
#print(count)

if s[0] == 'A':
    for i in range(2 , len(s)-2):
        if s[i] == "C" and count == 2:
            print("AC")
            break
        else:
            print("WA")
            break
else:
    print("WA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())
ans = True
li = list("abcdefghijklmnopqrstuvwxyzC")

if s[0]!="A":
    ans = False
memo = s[2:-1]
if not("C" in memo):
    ans = False
C_cnt = 0
for i in range(len(memo)):
    if not(memo[i] in li):
        ans = False
    if memo[i] == "C":
        C_cnt += 1

if ans and C_cnt==1:
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
s = list(input())
ans = True
li = list("abcdefghijklmnopqrstuvwxyzC")

if s[0]!="A":
    ans = False
memo = s[2:-1]
if not("C" in memo):
    ans = False
for i in range(len(memo)):
    if not(memo[i] in li):
        ans = False

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

Submission status: Wrong Answer

Solution code:
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))


s = list(input())
ans = True
li = list("abcdefghijklmnopqrstuvwxyz")

if s[0]!="A":
    ans = False
memo = s[2:-1]
if not("C" in memo):
    ans = False
for i in range(len(memo)):
    if not(memo[i] in li):
        ans = False

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

Submission status: Wrong Answer

Solution code:
s=input()
ans="AC"
if s[0]!="A":
    ans="WA"
c=0
idx=0
for i in range(2,len(s)-2):
    if s[i]=="C":
        c+=1
        idx=i
if c!=1:
    ans="WA"
small={"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"}
for i in range(1,len(s)):
    if i!=idx:
        if s[i] not in small:
            ans="WA"
            break
print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())

if "C" in s[2:-2] and s[0]=="A":
    del s[s.index("C")]
    del s[0]
else:
    print("WA")
    exit()

for i in range(len(s)):
    if s[i].islower()==True:
        continue
    else:
        print("WA")
        exit()
print("AC")

Submission status: Wrong Answer

Solution code:
s = list(input())

if "C" in s[2:-2] and s[0]=="A":
    del s[s.index("C")]
    del s[0]
else:
    print("WA")
    exit()
    
for i in range(len(s)):
    if s[i].islower():
        continue
    else:
        print("WA")
        exit()
print("AC")

Submission status: Wrong Answer

Solution code:
s = list(input())

if "C" in s[2:-2] and s[0]=="A":
    del s[s.index("C")]
    del s[0]

for i in range(len(s)):
    if s[i].islower():
        continue
    else:
        print("WA")
        exit()
print("AC")

Submission status: Wrong Answer

Solution code:
import sys

s = input()

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

if s[1] < "a" or s[1] > "z":
    print("WA")
    sys.exit(0)


sub = s[2:-1]
has = False
for c in sub:
    if not has and c == "C":
        has = True

    elif "a" <= c <= "z":
        continue

    else:
        has = False
        break

if not has:
    print("wA")
    sys.exit(0)

if "a" <= s[len(s) - 1] <= "z":
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
import sys

s = input()

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

sub = s[2:-1]
has = False
for c in sub:
    if c == "C":
        has = True
        break

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

Submission status: Wrong Answer

Solution code:
import math
import heapq
import sys
import re
from collections import Counter
import datetime
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

#N,K=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

s=input()
S=list(s)

if S[0]=='A':
    if S[2:-2].count('C')==1:
        if len(re.findall('[A-Z]', s))==2:
            print('AC')
            sys.exit()
    
print('WA')

Submission status: Wrong Answer

Solution code:
import math
import heapq
import sys
from collections import Counter
import datetime
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

#N,K=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

s=input()
S=list(s)

if S[0]=='A':
    if S[2:-2].count('C')==1:
        buf1=s[1]+s[3:]
        buf2=s[1:-2]+s[-1]
        if buf1.islower() or buf2.islower():
            print('AC')
            sys.exit()
    
print('WA')

Submission status: Wrong Answer

Solution code:
import math
import heapq
import sys
from collections import Counter
import datetime
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

#N,K=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

s=input()
S=list(s)
print(S[2:-2].count('C'))

if S[0]=='A':
    if S[2:-2].count('C')==1:
        buf1=s[1]+s[3:]
        buf2=s[1:-2]+s[-1]
        if buf1.islower() or buf2.islower():
            print('AC')
            sys.exit()
    
print('WA')

Submission status: Wrong Answer

Solution code:
import math
import heapq
import sys
from collections import Counter
import datetime
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

#N,K=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

s=input()
S=list(s)
print(S[2:-2].count('C'))

if S[0]=='A':
    if S[2:-2].count('C')==1:
        buf1=s[1]+s[3:]
        buf2=s[1:-3]+s[-1]
        if buf1.islower() or buf2.islower():
            print('AC')
            sys.exit()
    
print('WA')

Submission status: Wrong Answer

Solution code:
import math
import heapq
import sys
from collections import Counter
import datetime
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

#N,K=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

s=input()
S=list(s)

if S[0]=='A':
    if S[2:-2].count('C')==1:
        buf=s[1]+s[3:]
        if buf.islower():
            print('AC')
            sys.exit()
    
print('WA')

Submission status: Wrong Answer

Solution code:
import math
import heapq
import sys
from collections import Counter
import datetime
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

#N,K=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

S=input()
if S[0]=='A':
    if S[2]=='C' and S[-2]!='C' or S[2]!='C' and S[-2]=='C':
        buf=S[1]+S[3:]
        if buf.islower():
            print('AC')
            sys.exit()
    
print('WA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import re

txt = input()
z = re.match("A[a-z]+C[a-z]+", txt)

print("AC" if z else "WA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0
for i in range(2, len(S) - 1):
    if S[i].isupper() == True:
        cnt += 1

if cnt >= 3:
    flag = False

if 'C' not in S[2 : len(S) - 1]:
    flag = False

print('AC' if flag == True else 'WA')

Submission status: Wrong Answer

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

    if S[0] == 'A':
        count = 0
        for i in range(2, 2+len(S[2:-1])):
            if S[i] == 'C':
                count += 1
                index = i
        if count == 1:
            S = S[1:index]+S[index+1:]
            print(S)
            if S.islower():
                print('AC')
                return
    print('WA')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

    if S[0] == 'A':
        count = 0
        for i in range(2, 2+len(S[2:-2])):
            if S[i] == 'C':
                count += 1
                index = i
        if count == 1:
            S = S[1:index]+S[index+1:]
            print(S)
            if S.islower():
                print('AC')
                return
    print('WA')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

    if S[0] == 'A':
        if S[2]=='C' or S[3]=='C':
            S = S[1]+S[4:]
            if S.islower():
                print('AC')
                return
    print('WA')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8

s = input().rstrip()

def isValid(s:str):
    if s[0] != "A":
        return False
    if s[1] == s[1].upper():
        return False
    sub = s[2:-1]
    if len([i for i in sub if i == "C"]) != 1:
        return False

    sub2 = s[1] + sub.replace("C", "")
    if sub2 != sub2.lower():
        return False
    return True

ans = "AC"

if not isValid(s):
    ans = "WA"

print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

s = input().rstrip()

def isValid(s:str):
    if s[0] != "A":
        return False
    if s[1] == s[1].upper():
        return False
    sub = s[2:-1]
    if len([i for i in sub if i == "C"]) != 1:
        return False

    sub2 = sub.replace("C", "")
    if sub2 != sub2.lower():
        return False
    return True

ans = "AC"

if not isValid(s):
    ans = "WA"

print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

s = input().rstrip()

def isValid(s:str):
    if s[0] != "A":
        return False
    if s[1] == s[1].upper():
        return False
    sub = s[2:]
    if len([i for i in sub if i == "C"]) != 1:
        return False

    sub2 = sub.replace("C", "")
    if sub2 != sub2.lower():
        return False
    return True

ans = "AC"

if not isValid(s):
    ans = "WA"

print(ans)

Submission status: Wrong Answer

Solution code:
s=list(input())

if s[0]=='A':
    if s.count('C')==1 and s[1]!='C' and s[len(s)-1]!='C':
        s.remove('A')
        s.remove('C')
        s=''.join(s)
        if s.islower()==True:
            print('AC')        
    else:
        print('WA')
else:
    print('WA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

flag = [0] * 3

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

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

if Ccnt == 1:
	flag[1] = 1

if s.islower() is True:
	flag[2] = 1

if sum(flag) == 3:
	print('AC')
else:
	print('WA')

Submission status: Wrong Answer

Solution code:
s = str(input())
cnt = 0

if s[0]=='A' and s.count('C', 2, -1)==1:
        del list(s)[0]
        del list(s)[s.find('C', 1, -1)]
        t = s.upper()
        
        for i in range(len(s)):
            if s[i]==t[i].lower():
                cnt += 1
        if cnt==len(s):
            print('AC')
        else:
            print('WA')

else:
    print('WA')

Submission status: Wrong Answer

Solution code:
s = str(input())
tmp = 0
cnt = 0

if s[0]=='A':
    tmp += 1
if s.count('C', 2, len(s))==1:
    tmp += 1


if tmp!=2:
    print('WA')
    
else:
    list(s).remove('A')
    list(s).remove('C')
    t = s.upper()

    for i in range(len(s)):
        if s[i]!=t[i]:
            cnt += 1

    if cnt==len(s):
        print('AC')
    else:
        print('WA')

Submission status: Wrong Answer

Solution code:
s = list(input())
def h(list):
    count = 1
    C_count = 0
    for i in list:
        if len(list)-2>=count >= 3 and i == "C":
            C_count+=1
        count+=1
    return False

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

Submission status: Wrong Answer

Solution code:
S=input()

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

Submission status: Wrong Answer

Solution code:
S=input()
judge='AC'
cnt = 0

for i in range(len(S)):
    if S[i].isupper():
        if i == 0 or i == len(S) - 2 or S[i] != 'C':
            judge = 'WA'
        cnt+=1

if cnt != 1:
    judge = 'WA'
print(judge)

Submission status: Wrong Answer

Solution code:
S=input()
judge='AC'
cnt = 0

for i in range(1, len(S)):
    if S[i].isupper():
        if i == 1 or i == len(S) -1 or S[i] != 'C':
            judge = 'WA'
        cnt+=1

if cnt != 1:
    judge = 'WA'
print(judge)

Submission status: Wrong Answer

Solution code:
S=input()
judge='AC'
cnt = 0

for i, s in enumerate(S):
    if i == 0:
        if s == 'A':
            continue
        else:
            judge='WA'
            break
    elif i == 2 and i > (len(S) - 2):
        if s == 'C':
            cnt += 1
            continue
    
    if s.isupper():
        judge = 'WA'
        break

if cnt != 1:
    judge = 'WA'
print(judge)

Submission status: Wrong Answer

Solution code:
S=input()
judge='AC'
cnt = 0

for i, s in enumerate(S):
    if i == 0:
        if s == 'A':
            continue
        else:
            judge='WA'
            break
    elif i == 2 or (i > (len(S) - 2) and i < len(S) - 1):
        if s == 'C':
            cnt += 1
            continue
    
    if s.isupper():
        judge = 'WA'
        break

if cnt != 1:
    judge = 'WA'
print(judge)

Submission status: Wrong Answer

Solution code:
S=input()
judge='AC'
cnt = 0

for i, s in enumerate(S):
    if i == 0:
        if s == 'A':
            continue
        else:
            judge='WA'
            break
    elif i == 2 or (i > (len(S) - 2) and i < len(S)):
        if s == 'C':
            cnt += 1
            continue
    
    if s.isupper():
        judge = 'WA'
        break

if cnt != 1:
    judge = 'WA'
print(judge)

Submission status: Wrong Answer

Solution code:
S=input()
judge='AC'
cnt = 0

for i, s in enumerate(S):
    if i == 0:
        if s == 'A':
            continue
        else:
            judge='WA'
            break
    elif i == 2 or (i >= (len(S) - 3) and i < len(S)-1):
        if s == 'C':
            cnt += 1
            continue
    
    if s.isupper():
        judge = 'WA'
        break

if cnt != 1:
    judge = 'WA'
print(judge)

Submission status: Wrong Answer

Solution code:
S=input()
judge='AC'
cnt = 0

for i, s in enumerate(S):
    if i == 0:
        if s == 'A':
            continue
        else:
            judge='WA'
            break
    elif i == 2 or (i > (len(S) - 2) and i < len(S)-1):
        if s == 'C':
            cnt += 1
            continue
    
    if s.isupper():
        judge = 'WA'
        break

if cnt != 1:
    judge = 'WA'
print(judge)

Submission status: Wrong Answer

Solution code:
S=input()
judge='AC'
cnt = 0

for i, s in enumerate(S):
    if i == 0:
        if s == 'A':
            continue
        else:
            judge='WA'
            break
    elif i == 2 or i > (len(S) - 2):
        if s == 'C':
            cnt += 1
            continue
    
    if s.isupper():
        judge = 'WA'
        break

if cnt != 1:
    judge = 'WA'
print(judge)

Submission status: Wrong Answer

Solution code:
S=input()
judge='AC'
cnt = 0
for i, s in enumerate(S):
    if i == 0:
        if s == 'A':
            continue
        else:
            judge='WA'
            break
        
    elif i > 1 and i < (len(S) - 3):
        if s == 'C':
            cnt += 1
            continue
    if s.isupper():
        judge = 'WA'
        break

if cnt != 1:
    judge = 'WA'
print(judge)