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()
if (s[0] == "A") and (s[2] == "C") :
    letter = set(s[1] + s[3:])
    import string
    if letter <= set(string.ascii_lowercase) :
        print("AC")
    else :
        print("WA")
else :
    print("WA")

Submission status: Wrong Answer

Solution code:
s = input()

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

if s[2:len(s)-1].count('C') > 1 or s[2:len(s)-1].count('C') < 1:
	print("WA")
	exit(0)

s = s[1:]
s = s[1:len(s)-1].replace("C", "")

if s.islower():
	print("AC")
else:
	print("WA")

Submission status: Wrong Answer

Solution code:
s = input()

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

if s[2] == "C" and s[len(s)-2] == "C":
	print("WA")
	exit(0)
elif s[2] != "C" and s[len(s)-2] != "C":
	print("WA")
	exit(0)

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

Submission status: Wrong Answer

Solution code:
s = input()

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

if s[2] == "C" and s[len(s)-2] == "C":
	print("WA")
	exit(0)
elif s[2] != "C" and s[len(s)-2] != "C":
	print("WA")
	exit(0)

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

Submission status: Wrong Answer

Solution code:
s = input()

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

if s[2] == "C" and s[len(s)-2] == "C":
	print("WA")
	exit(0)
elif s[2] != "C" and s[len(s)-2] != "C":
	print("WA")
	exit(0)

s = s[1] + s[3:len(s)-2] + s[len(s)-1]

if s.islower():
	print("AC")
else:
	print("WA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# ABC 104: B – AcCepted
s = input()

lowers = 'abcdefghijklmnopqrstuvwxyz'
is_satisfied = 'AC'

print(s[2:-1])

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

print(is_satisfied)

Submission status: Wrong Answer

Solution code:
# ABC 104: B – AcCepted
s = input()

lowers = 'abcdefghijklmnopqrstuvwxyz'
is_satisfied = 'AC'

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

print(is_satisfied)

Submission status: Wrong Answer

Solution code:
# ABC 104: B – AcCepted
s = input()

lowers = 'abcdefghijklmnopqrstuvwxyz'
is_satisfied = 'AC'

if s[0] == 'A' and 'C' in s[2:-2] and s[2:-2].count('C') == 1:
    for letter in s:
        if letter != 'A' and letter != 'C':
            if letter not in lowers:
                is_satisfied = 'WA'
else:
    is_satisfied = 'WA'

print(is_satisfied)

Submission status: Wrong Answer

Solution code:
# ABC 104: B – AcCepted
s = input()

lowers = 'abcdefghijklmnopqrstuvwxyz'
is_satisfied = 'AC'

if s[0] == 'A' and 'C' in s[2:-2] and s.count('C') == 1:
    for letter in s:
        if letter != 'A' and letter != 'C':
            if letter not in lowers:
                is_satisfied = 'WA'
else:
    is_satisfied = 'WA'

print(is_satisfied)

Submission status: Wrong Answer

Solution code:
# ABC 104: B – AcCepted
s = input()

lowers = 'abcdefghijklmnopqrstuvwsyz'
is_satisfied = 'AC'

if s[0] == 'A' and 'C' in s[2:-2] and s.count('C') == 1:
    for letter in s:
        if letter != 'A' and letter != 'C':
            if letter not in lowers:
                is_satisfied = 'WA'
else:
    is_satisfied = 'WA'

print(is_satisfied)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
ans = False
if(S[0]=="A" and S[2:len(S)-1].find("C") != -1):
    S = S.replace("C","c")
    ans = S[1:].islower()
if(ans):
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
S = input()
ans = False
if(S[0]=="A" and S.find("C") != -1):
    S = S.replace("C","c")
    ans = S[1:].islower()
if(ans):
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
S = input()
n = len(S)
p = 0
if S[0] == 'A':
    p = 1
s = []
for i in range(2,n-1):
    s.append(S[i])
q = 0
if s.count('C') == 1:
    q = 1
r = p*q
ans = 'WA'
if r == 1:
    ans = 'AC'
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
n = len(S)
p = 0
if S[0] == 'A':
    p = 1
q = 0
for i in range(2,n-1):
    if S[i] == 'C':
        q = 1
        break
r = p*q
ans = 'WA'
if r == 1:
    ans = 'AC'
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
S=list(s)
t=S
count=0
c=0
ans='AC'
if S[0]!='A':
    ans='WA'
for i in range(2,len(t)-1):
    if t[i]=='C':
        count+=1
if count!=1:
    ans='WA'
if ans!='WA':
    for j in range(len(S)):
        if S[j]=='A' or 'C':
            S.remove(S[j])
            c+=1
        if c==2:
            break
    for k in range(len(S)):
        x=S[k].lower()
        if S[k]!=x:
            ans='WA'
            break
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
S=list(s)
t=S
count=0
ans='AC'
if S[0]!='A':
    ans='WA'
for i in range(2,len(t)-1):
    if t[i]=='C':
        count+=1
if count!=1:
    ans='WA'
if ans!='WA':
    for j in range(len(S)):
        if S[j]=='A' or 'C':
                continue
        else:
            if S[j]!=S[j].lower():
                ans='WA'
                break
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
S=list(s)
t=S
count=0
ans='AC'
if S[0]!='A':
    ans='WA'
t.remove(t[0])
t.remove(t[0])
t.remove(t[len(t)-1])
for i in range(len(t)):
    if t[i]=='C':
        count+=1
if count!=1:
    ans='WA'
if ans!='WA':
    for j in range(len(S)):
        if S[j]=='A' or 'C':
                continue
        else:
            if S[j]!=S[j].lower():
                ans='WA'
                break
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
S=list(s)
t=S
count=0
ans='AC'
if S[0]!='A':
    ans='WA'
t.remove(t[0])
t.remove(t[0])
t.remove(t[len(t)-1])
for i in range(len(t)):
    if t[i]=='C':
        count+=1
if count!=1:
    ans='WA'
if ans!='WA':
    for i in range(len(S)):
        if S[i]=='A' or 'C':
                continue
        else:
            if S[i]!=S[i].lower():
                ans='WA'
                break
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
s = input()
s = [c for c in s]
flg = False
if s[0] == 'A':
    if s[2:-1].count('C') == 1:
        if s.count('C') == 1:
            s.remove('A')
            s.remove('C')
            print(s)
            for c in s:
                if not c.islower():
                    flg = False
                    break
                flg = True
print('AC' if flg else 'WA')

Submission status: Wrong Answer

Solution code:
import sys
s = input()
s = [c for c in s]
flg = False
if s[0] == 'A':
    if s[2:-1].count('C') == 1:
        if s.count('C') == 1:
            s.remove('A')
            s.remove('C')
            for c in s:
                if not c.islower():
                    break
                flg = True
print('AC' if flg else 'WA')

Submission status: Wrong Answer

Solution code:
import sys
s = input()
s = [c for c in s]
flg = False
if s[0] == 'A':
    if s[2:-1].count('C') == 1:
        if s.count('C') == 1:
            s.remove('A')
            s.remove('C')
            for c in s:
                if not c.islower:
                    break
                flg = True
print('AC' if flg else 'WA')

Submission status: Wrong Answer

Solution code:

inp = input()
count = 0
index = 0
for i in range(len(inp[2:-1])):
  if inp[2:-1][i] == "C":
      count += 1
      index = i
if inp[0] == "A":
  if count == 1:
    if (inp[1:2+index]+inp[3+index:]).islower():
        print("AC")
else: 
  print("WA")

Submission status: Wrong Answer

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

S = input()
flag = 0
if(S[0] == 'A'):
  if(len(re.findall('C', S[2:-2])) == 1):
    index = S[2:-2].find('C') + 2
    ss = 'a' + S[1:index] + 'c' + S[index+1:]
    if(S.lower() == ss):
      flag = 1

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

Submission status: Wrong Answer

Solution code:
s = input()

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

else:
    print('WA')

Submission status: Wrong Answer

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

# input
S = input()

# solve
ans = False
if S[0] == 'A' and S[1] != 'C' and S[2:len(S) - 1].count('C') == 1:
    ans = True

# output
print('AC' if ans else 'WA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

    margin = s[2:len(s) - 1]
    count = 0

    for i in margin:
        if i == "C":
            count += 1
        if count >= 2:
            print("WA")
            return

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


main()

Submission status: Wrong Answer

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

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

    margin = s[2:len(s) - 1]
    s = s[1:]
    count = 0

    for i in margin:
        if i == "C":
            count += 1
        if count >= 2:
            print("WA")
            return

    if count != 1:
        print("WA")
        return

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


main()

Submission status: Wrong Answer

Solution code:
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


def main():
    S = input()[:-1]
    
    if S[:1]!="A":
        print("WA")
        return
    if S[2:len(S)-1].count("C")!=1:
        print("WA")
        return
    for i in range(1, len(S)):
        if S[i:i+1].isupper() and S[i:i+1] not in "AC":
            print("WA3")
            return
    
    print("AC")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
S = input()
ans = "AC"
count = 0
for j in range(2,len(list(S))-1):
    if S[j] == "C":
        count += 1
for i in range(len(list(S))):
    if S[i].islower == "False" and S[i] not in ["A","C"]:
        ans = "WA"
        break
if S[0] != "A":
    ans = "WA"
if count != 1:
    ans = "WA"
if S[0] == "C" or S[1] == "C" or S[-1] == "C" or S[-2] == "C":
    ans = "WA"
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
ans = "AC"
count = 0
for j in range(2,len(list(S))-1):
    if S[j] == "C":
        count += 1
for i in range(len(list(S))):
    if S[i].islower == "False" and S[i] not in ["A","C"]:
        ans = "WA"
        break
if S[0] != "A":
    ans = "WA"
if count != 1:
    ans = "WA"
print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())
count = 0
flag = 1
if s[0] == "A":
    s[0] = s[0].lower()
else:
    flag = 0
for i in range(2, len(s)-1):
    if s[i] == "C":
        s[i] = s[i].lower()
        count += 1
ss = "".join(s)
if ss.isupper() or count != 1:
    flag = 0
if flag == 1: print("AC")
else: print("WA")

Submission status: Wrong Answer

Solution code:
s = list(input())
count = 0
flag = 1
if s[0] == "A":
    s[0] = s[0].lower()

for i in range(2, len(s)-1):
    if s[i] == "C":
        s[i] = s[i].lower()
        count += 1
ss = "".join(s)
if ss.isupper() or count != 1:
    flag = 0
else:
    flag = 0
if flag == 1: print("AC")
else: print("WA")

Submission status: Wrong Answer

Solution code:
s = list(input())
count = 0
flag = 1
if s[0] == "A":
    s[0] = s[0].lower()

for i in range(2, len(s)-1):
    if s[i] == "C":
        s[i] = s[i].lower()
        count += 1
ss = "".join(s)
if ss.isupper() or count != 1:
    flag = 0
if flag == 1: print("AC")
else: print("WA")

Submission status: Wrong Answer

Solution code:
s = list(input())
count = 0
flag = 1
if s[0] == "A":
    s[0] = s[0].lower()
    for i in range(len(s)):
        if (i >= 2 and i <= len(s)-2) and s[i] == "C":
            s[i] = s[i].lower()
            count += 1
    for i in s:
        if str(i).isupper():
            flag = 0
            break
    if count != 1:
        flag = 0
else:
    flag = 0
if flag == 1: print("AC")
else: print("WC")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#2019/10/22

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

Submission status: Wrong Answer

Solution code:
S = list(input())

ac = False
if S[0] == "A":
    if S[2:len(S)-1].count("C") == 1:
        ac = True

upper = False
count = 0
for i in S:
    if i.isupper():
        count += 1

if count == 1:
    upper = True

if ac and upper:
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
S = list(input())

ac = False
if S[0] == "A":
    if S[2:len(S)-1].count("C") == 1:
        ac = True

upper = False
count = 0
for i in S[2:len(S)-1]:
    if i.isupper():
        count += 1

if count == 1:
    upper = True

if ac and upper:
    print("AC")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
S = list(input())

if S[0] == "A":
    if S[2:len(S)].count("C") == 1:
        print("AC")
        exit()

print("WA")

Submission status: Wrong Answer

Solution code:
S = list(input())

if S[0] == "A":
    if S[2:len(S)-1].count("C") == 1:
        print("AC")
        exit()

print("WA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())

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

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

s.remove("A")
s.remove("C")
s_in = "".join(s)

if not s_in.islower():
    print("WA")
    exit()

print("AC")

Submission status: Wrong Answer

Solution code:
# ord("A") → 65
# ord("C") → 67
# ord("Z") → 90
# ord("a") → 97

S=list(input())
S_int=list(map(lambda x:ord(x),S))

flg=False

if S[0]=="A":
    if S[2:-2].count("C")==1:
        remove_omoji=[x for x in S_int if x>96]
        if len(S_int)-2==len(remove_omoji): flg=True

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

ac = True

if S[0] != "A":
    ac = False

cnt = 0
for s in S[2:-2]:
    if s == "C":
        cnt += 1
if cnt != 1:
    ac = False

for s in S[1:]:
    if s != "C" and s.isupper():
        ac = False

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

Submission status: Wrong Answer

Solution code:
import numpy

def judge(S):
    if S[0] != 'A':
        return print("WA")
    elif S[2:-1].count("C") == 1:
        return print("AC")
    else:
        return print("WA")

if __name__ == "__main__":
    S = input()
    judge(S)

Submission status: Wrong Answer

Solution code:
S=input()

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

if S[2]=='C' and S.count('C')==1:
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
S=input()

if 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:
def solve(s):
    if(s[0] == "A"):
        v = s[1:]
        i = v.find("C")
        print(i)
        if(i >= 1 and i < len(s)):
            k = v[:i] + v[i+1:]
            print(k)
            if(k.islower()):
                return "AC"
    return "WA"

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

Submission status: Wrong Answer

Solution code:
def solve(s):
    if(s[0] == "A"):
        v = s[1:]
        i = s.find("C")
        if(i >= 2 and i < len(s)):
            k = v[:i-1] + v[i:]
            if(k.islower()):
                return "AC"
    return "WA"

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

Submission status: Wrong Answer

Solution code:
import string
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline


def main():
    S = input()[:-1]

    A = string.ascii_uppercase
    ans = "AC"
    if S[:1]!="A":
        ans = "WA"
    if S[1:2] in A:
        ans = "WA"
    cnt = 0
    for i in range(2, len(S)-2):
        if S[i:i+1]=="C":
            cnt += 1
        elif S[i:i+1] in A:
            ans = "WA"
    if cnt!=1:
        ans = "WA"
    for i in range(len(S)-2, len(S)):
        if S[i:i+1] in A:
            ans = "WA"
    
    print(ans)
            

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s=list(input())
count=0
if s[0]!='A':
    count+=2
for i in range(2,len(s)-2):
    if s[i]=='C':
        count+=1

if count==1:
    s.remove('A')
    s.remove('C')    
    res=''.join(s)
    print('AC' if res.islower()==True else 'WA') #str.islower():全部小文字ならTrue

else:
    print('WA')

Submission status: Wrong Answer

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

if count==1:
    s.remove('A')
    s.remove('C')    
    res=''.join(s)
    print('AC' if res.islower()==True else 'WA') 
else:
    print('WA')

Submission status: Wrong Answer

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

if count==1:
    s.remove('A')
    s.remove('C')    
    res=''.join(s)
    print('AC' if res.islower()==True else 'WA') 
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
s=list(input())
if s[0]!='A':
    print('WA')
    exit()
count=0
for i in range(2,len(s)-2):
    if s[i]=='C':
        count+=1

if count==1:
    s.remove('A')
    s.remove('C')    
    res=''.join(s)
    print('AC' if res.islower()==True else 'WA') 
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
s=list(input())
if s[0]!='A':
    print('WA')
    exit()
count=0
for i in range(2,len(s)-2):
    if s[i]=='C':
        count+=1

if count==1:
    s.remove('A')
    s.remove('C')
else:
    print('WA')
    exit()
res=''.join(s)
print('AC' if res.islower()==True else 'WA') #str.islower():全部小文字ならTrue

Submission status: Wrong Answer

Solution code:
s=list(input())
if s[0]!='A':
    print('WA')
    exit()
count=0
for i in range(2,len(s)-2):
    if s[i]=='C':
        count+=1

if count==1:
    s.remove('A')
    s.remove('C')
res=''.join(s)
print('AC' if res.islower()==True else 'WA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())
#print(s)
if s[0]!='A':
    print('WA')
    exit()
else:
    del s[0]
    for i in range(1,len(s)-2):
        if s[i] =='C':
            del s[i]
            if not str.islower(str(s)):
                print('WA')
                exit()
            else:
                print('AC')
                exit()
        print('WA')
        exit()

Submission status: Wrong Answer

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

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

if 'C' not in s[2:-1]:
  ans = 'WA'
  
if not s.replace('A', '').replace('C', '').islower():
  ans = 'WA'
  
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


def judg(s):
    if s[0] != "A":
        return False
    if "C" not in s[2:-1] and s[2:-1].count("C") != 1:
        print("C")
        return False
    del s[s.index("C")]
    s = "".join(s[1:])
    if s.lower() != s:
        return False
    return True


def main():
    s = list(input().strip())

    if judg(s):
        print("AC")
    else:
        print("WA")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys
S = list(input())
N = len(S)
if S[0] == "A":
    s = 0
    for i in S[1:len(S)-1]:
        if i == "C":
            s += 1
    if s == 1:
        c = 0
        for i in S:
            if i.islower():
                 c += 1
        if c == N-2:
            print("AC")
            sys.exit()
print("WA")

Submission status: Wrong Answer

Solution code:
S = input()

cnt = 0
if S[0] != 'A' or S[-1] == 'C':
    cnt += 1

A = S.replace('A', '')
A = A.replace('C', '')
if len(S) -2 != len(A) or A.islower() == False:
    cnt += 1
if cnt > 0:
    print('WA')
else:
    print('AC')

Submission status: Wrong Answer

Solution code:
s =list(input())
ans =0
for i in range(len(s)):
  if s[0] =='A':
    a = s.pop(0)
    if s[1] =='C':
      a = s.pop(1)
  else:
    ans =1
s = ''.join(s)  

print('AC' if s.islower() and ans ==0  else 'WA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
count_C = 0
count_komoji = 0
k = ["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"]
if s[0] == "A":
  for i in range(2,len(s)-1):
    if s[i] == "C":
      count_C += 1
    elif s[i] in k:
      count_komoji += 1
  if count_C == 1:
    if count_komoji == len(s)-2:
      if s[len(s)] in k:
        print("AC")
      else:
        print("WA")
    else:
      print("WA")
  else:
    print("WA")
else:
  print("WA")

Submission status: Wrong Answer

Solution code:
S = input()
ans = True


if S[0] != "A":
    ans = False

elif "C" not in S[2:-2]:
    ans = False

elif not S[1].islower():
    ans = False

elif not S[3:].islower():
    ans = False

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

Submission status: Wrong Answer

Solution code:
S = input()
ans = True


if S[0] != "A":
    ans = False

elif S[2] != "C":
    ans = False

elif not S[1].islower():
    ans = False

elif not S[3:].islower():
    ans = False

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    import re
    pattern="^A[a-z]+C[a-z]*[a-z]{2}$"
    print("AC" if re.match(pattern,input()) else "WA")
resolve()

Submission status: Wrong Answer

Solution code:
S = input()
if S[0] == "A":
    flag = False
    index = -1
    for i, x in enumerate(S[2:-2]):
        if x == "C":
            if flag:
                flag = False
                break
            else:
                flag = True
                index = i
    if flag:
        if (len(S[1:i-1]) == 0 or S[1:i-1].islower()) and (len(S[i+1]) == 0 or S[i+1:].islower()):
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:
S = input()
if S[0] == "A":
    flag = False
    index = -1
    for i, x in enumerate(S[2:-2]):
        if S[i] == "C":
            if flag:
                flag = False
                break
            else:
                flag = True
                index = i
    if flag:
        if (len(S[1:i-1]) == 0 or S[1:i-1].islower()) and (len(S[i+1]) == 0 or S[i+1:].islower()):
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Submission status: Wrong Answer

Solution code:

def main():
    S = input()
    flag1 = S[0] == 'A'
    if not flag1:
        print('WA')
        return 
    mid = S[2:-1]
    flag2 = mid.count('C') == 1
    if not flag2:
        print('WA')
        return
    index = S.index('C')
    tmp = S[1:index] + S[index+1:]
    flag3 = tmp.islower()
    if not flag3:
        print('WA')
    print('AC')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

def main():
    S = input()
    flag1 = S[0] == 'A'
    if not flag1:
        print('WA')
        return 
    mid = S[2:-1]
    flag2 = mid.count('C') == 1
    if not flag2:
        print('WA')
        return
    index = S.index('C')
    tmp = S[1:index] + S[index+1:]
    print(tmp)
    flag3 = tmp.islower()
    if not flag3:
        print('WA')
    print('AC')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

def main():
    S = input()
    flag1 = S[0] == 'A'
    if not flag1:
        print('WA')
        return 
    mid = S[2:-1]
    flag2 = mid.count('C') == 1
    if not flag2:
        print('WA')
        return
    index = S.index('C')
    tmp = S[1:index] + S[index+1:]
    flag3 = tmp.islower
    if not flag3:
        print('WA')
    print('AC')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
S = input()
head = S[0]
mid = S[2:-1]
arr = [c for c in S]
flag1 = head == 'A'
flag2 = mid.count('C') == 1
if mid.count('C') == 1:
    index = S.index('C')
    tmp = S[1:index] + S[index+1:]
    flag3 = tmp.islower
else:
    flag3 = False
if (flag1 and flag2 and flag3):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
S = input()
head = S[0]
mid = S[2:-1]
arr = [c for c in S]
flag1 = head == 'A'
flag2 = mid.count('C') == 1
if 'C' in S:
    index = S.index('C')
    tmp = S[1:index] + S[index+1:]
    flag3 = tmp.islower
else:
    flag3 = False
    

if (flag1 and flag2 and flag3):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

Solution code:
S = input()
head = S[0]
mid = S[2:-1]
arr = [c for c in S]
flag1 = head == 'A'
flag2 = mid.count('C') == 1
if 'C' in S:
    index = S.index('C')
else:
    index = 0
tmp = S[1:index] + S[index+1:]
flag3 = tmp.islower
if (flag1 and flag2 and flag3):
    print('AC')
else:
    print('WA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

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

if s[2:-1] not in "C":
    print("WA")
    exit()

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

Submission status: Wrong Answer

Solution code:
s = input()

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

if s[3:-1] not in "C" or s[:2] in "C" or s[-1] in "C":
    print("WA")
    exit()

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

Submission status: Wrong Answer

Solution code:
s = input()

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

if s[3:-1] not in "C":
    print("WA")
    exit()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

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


S=input()

if S[0]=="A" and S[2]=="C" and S[1].islower() and S[3:].islower():
	print("AC")
else:
	print("WA")

Submission status: Wrong Answer

Solution code:
import sys

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


S=input()

if S[0]=="A" and S[2]=="C" and S[1].islower() and S[:3].islower():
	print("AC")
else:
	print("WA")

Submission status: Wrong Answer

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