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=input()
abc='abcdefghijklmnopqrstuvwxyz'
a=s[0]
b=s[2:-1]

check=0
for i in range(len(s)):
    if s[i] in abc:
        check +=1
        
print('AC' if a=='A' and 'C' in b and check+2==len(s) else 'WA')

Submission status: Accepted

Solution code:
s = input()

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

cnt = 0
i = 0
for j, c in enumerate(s):
    if j <= 1 or j == len(s) - 1:
        continue
    if c == 'C':
        cnt += 1
        if cnt == 2:
            print('WA')
            exit(0)
        i = j
if cnt == 0:
    print('WA')
    exit(0)

for j, c in enumerate(s):
    if j == 0 or j == i:
        continue
    if str(c).isupper():
        print('WA')
        exit(0)

print('AC')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())

if s[0]=='A' and s[1].islower():
    s=s[2:]
    if s[:len(s)-1].count('C')==1:
        s_last=s[-1]
        s=s[:len(s)-1]
        s.remove('C')
        s=s+[s_last]
        for i in range(len(s)):
            if not s[i].islower():
                print("WA")
                exit()    
        print("AC")
        exit()
print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
S = input()
flag_1 = False
flag_2 = False
flag_3 = False

if S[0] == 'A': flag_1 = True
if S[2:-1].count('C') == 1: flag_2 = True

if flag_1 == True and flag_2 == True:
   if len(re.findall('[A-Z]', S)) == 2:
       flag_3 = True

if flag_1 == True and flag_2 == True and flag_3 == True:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
import sys
from collections import deque
import copy

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    S = inputs[0]
    if S[0] != 'A':
        return 'WA'

    count = 0
    for i in range(1, len(S)):
        if i >= 2 and i <= len(S) - 2 and S[i] == 'C':
            count += 1
        else:
            if not (S[i] >= 'a' and S[i] <= 'z'):
                return 'WA'

    if count == 1:
        return "AC"

    return 'WA'


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
S = s[2:-1]
if s[0]=='A' and S.count('C')==1 and s[1:s.index('C')].lower()==s[1:s.index('C')] and s[s.index('C')+1:].lower()==s[s.index('C')+1:]:
  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':
    index = S.find('C')
    new_S = S[1:index] + S[(index + 1):]
    if 1 < index < len(S) - 1 and new_S.islower():
        print('AC')
        exit()

print('WA')

Submission status: Accepted

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

if "".join(judge).islower() or "".join(judge) == "":
    print("AC")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    s = input()
    c0 = s[0] == "A"
    c1 = s[2:-1].count("C") == 1
    c2 = sum([1 for c in s if c.isupper()]) == 2
    return "AC" if c0 and c1 and c2 else "WA"


if __name__ == "__main__":
    print(solve())

Submission status: Accepted

Solution code:
def wa_exit():
    print('WA')
    exit()


s = input()

if s[0] != 'A':
    wa_exit()
if 'C' not in s[2:-1]:
    wa_exit()
for i, c in enumerate(s):
    if i == 0 or i == s.index('C'):
        continue
    if c.isupper():
        wa_exit()

print('AC')

Submission status: Accepted

Solution code:

s = input()
if s[0] == 'A':
    if s[2:-1].count('C') == 1:
        idx = s.index('C')
        x = s[1:idx] + s[idx+1:]
        if x == x.lower():
            print('AC')
            exit()

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()
else:
    S = S.replace('A', '')
    S = S.replace('C', '')
    if S != S.lower():
        print('WA')
        exit()

print('AC')

Submission status: Accepted

Solution code:
import sys

S = list(input())

if S[0] == "A":
    S.remove("A")
else:
    print("WA")
    sys.exit()

if S[1:-1].count("C") == 1:
    S.remove("C")
else:
    print("WA")
    sys.exit()

if "".join(S).islower():
    print("AC")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

ans = "AC"
tmp = S[2:-1]

if S[0] != "A":
  ans = "WA"
else:
  S = S.replace("A", "")
  
count = 0
for item in tmp:
  if item == "C":
    count += 1
    
if count != 1:
  ans = "WA"
elif count == 1:
  S = S.replace("C", "")

if not S.islower():
  ans = "WA"

print(ans)

Submission status: Accepted

Solution code:
S = list(input())

ans = "AC"
tmp = S[2:-1]

if S[0] != "A":
  ans = "WA"
else:
  S.remove("A")
  
count = 0
for item in tmp:
  if item == "C":
    count += 1
    
if count != 1:
  ans = "WA"
elif count == 1:
  S.remove("C")


if "".join(S).lower() != "".join(S):
  ans = "WA"

print(ans)

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=list(input())
w=0
c=0
if s[0]!='A':
    w=1
if s[1].isupper():
    w=1
for i in range(2,len(s)-1):
    if s[i]!='C' and s[i].isupper():
        w=1
    elif s[i]=='C':
        c+=1
if s[-1].isupper():
    w=1
if w==0 and c==1:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s=input()
from collections import Counter
ans='AC'
if s[0]=='A' and Counter(s[2:-1]).get('C')==1:
  for x in sorted(s)[2:]:
    if x.isupper():
      ans='WA'
      break
else:
  ans='WA'
print(ans)

Submission status: Accepted

Solution code:
import re

def main():
    S = input()

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

main()

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()
#一文字だけ削除するのめんどい
#文字列はイミュータブルだからか
#下のURLで色々方法みれる
if s[0]=="A" and s[2:-1].count("C")==1 and s[1:].replace("C","").islower():
    print("AC")
else:
    print("WA")




#http://myprogramming.hatenablog.com/entry/2017/07/23/191308

Submission status: Accepted

Solution code:
import string


def main(S):
    if not S[0] == 'A' or S[1] == 'C':
        return 'WA'
    if S.endswith('C'):
        return 'WA'

    count_upper = 0
    for upper in string.ascii_uppercase:
        count_upper += S.count(upper)

    if count_upper != 2:
        return 'WA'

    count_C = 0

    for s in S[2:]:
        if s == 'C':
            if count_C == 1:
                return 'WA'
            else:
                count_C += 1
                continue
        elif not s.islower():
            return 'WA'

    if count_C == 0:
        return 'WA'

    return 'AC'


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

Submission status: Accepted

Solution code:
s = input()
ans = "AC"
if s[0] != "A":
    ans = "WA"
elif "C" not in s[2:len(s)-1]:
    ans = "WA"
else:
    cnt = 0
    for i in range(1,len(s)):
        if s[i] == "C":
            cnt += 1
        elif s[i].isupper():
            ans = "WA"
            break
        if cnt > 1:
            ans = "WA"
print(ans)

Submission status: Accepted

Solution code:
import math
import copy
import sys

inputa = input().split()
# inputb = input().split()
# inputc = input().split()

# a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

# inputaList = [int(n) for n in inputa]

# inputb = input().split()
# inputbList = [int(n) for n in inputb]
#
# inputList = []
# inputNumList = []
# for i in range(a):
#     inputNum = input()
#     inputNumList = list(inputNum)
#     inputList.append(inputNumList)

# inputList = [int(n) for n in inputList]

# b = [int(n) for n in inputb]
# c = [int(n) for n in inputc]

a = str(inputa[0])
inputList = list(a)

flg = True

if inputList[0] != "A":
    flg = False

cntC = 0
for i in range(2, len(inputList)-1, 1):
    if inputList[i] == "C":
        cntC += 1

if cntC != 1:
    flg = False

for i in range(len(inputList)):
    if inputList[i] != "A" and inputList[i] != "C":
        if inputList[i].islower() == False:
            flg = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

s = input()
print('AC'if s[0] == 'A' and s[2:-1].count('C') == 1 and re.sub('A|C','',s) == re.sub('A|C','',s).lower() else 'WA')

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline

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

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline

s = input().strip()
if s[0] == "A":
    if s[2:-1].count("C") == 1:
#        print(s[2:-1])
        tmp = s[2:-1].replace("C","",1)
        s = s[1:2] + tmp + s[-1]
#        print(s)
        b = True
        for c in s:
            if c < "a":
                b = False
                break
        if b:
            print("AC")
            exit()
print("WA")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())

def check(S):
    if not S[0]=="A":
        return False
    if not S[2:-1].count("C")==1:
        return False
    NG=[0, S.index("C")]
    for i,s in enumerate(S):
        if i in NG:
            continue
        if s.isupper():
            return False
    return True

print("AC") if check(s) else print("WA")

Submission status: Accepted

Solution code:
def resolve():
    s = input()
    sss = [i for i in s]
    flag = False
    if s[0] == "A":
        sss[0] = "a"
        if s[2:-1].count("C") == 1:
            sss[sss.index("C")] = "c"
            s = "".join(sss)
            if s.islower():
                flag = True
                print("AC")
    if not flag:
        print("WA")
        
resolve()

Submission status: Accepted

Solution code:
s = list(input())
temp_s = s[2:-1]
#print(temp_s)

if (s[0]=="A")and("C" in temp_s):
  s.remove("A")
  s.remove("C")
  temp = s.copy()
  if len(set(s) - set(list("".join(temp).lower())))==0:
    print("AC")
  else:
    print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
S = input()

count = 0
hantei = 0

if S[0] == "A":
    count += 1

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

for i in range(1,len(S)):
    if "C"!= S[i] and S[i].isupper() == 1:
        hantei = 1
        break


if count == 2 and S.count("C") == 1 and hantei == 0:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
# ABC104-B
S = input()
# S = "AtCoder"
flag = True
if S[0] != 'A':
    flag = False
    # print(1)
if S.count('C') != 1:
    flag = False
    # print(2)
if S.find('C') == 0 or S.find('C') == 1 or S.find('C') == len(S) - 1:
    flag = False
    # print(3)
S = S.replace('A', 'a')
S = S.replace('C', 'c')
if S.islower() == False:
    flag = False
    # print(4)
if flag:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s = list(input())
if s[0] == 'A' and s[2:-1].count('C') == 1:
    s = s[1:]
    s.remove('C')
    new_s = []
    for i in range(len(s)):
        new_s.append(s[i].lower())
    if s == new_s:
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = input()

flag = True

# print(flag)
# print(s[0])

if s[0] != 'A':
    # print('1st condition is not fulfill.')
    flag = False

# print(flag)
# print(s[2:-1],s[2:-1].count('C'))
if s[2:-1].count('C') != 1:
    # print('2nd condition is not fulfill.')
    flag = False

# print(flag)
t = s[1:2 + s[2:-1].find('C')]+s[3 + s[2:-1].find('C'):]
# print(t)
# print(t,t.islower())
if t.islower() != True:
    # print('3rd condition is not fulfill.')
    flag = False

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

Submission status: Accepted

Solution code:
s = input()
a = s[2:]
a = a[::-1]
a = a.replace(a[0],'',1)
a = a[::-1]
cnt = 0
for i in list(s):
  if i.isupper() == True:
    cnt += 1
if s[0] !='A' or a.count('C') != 1 or cnt != 2:
  print('WA')
else:
    print('AC')

Submission status: Accepted

Solution code:
from collections import Counter

def main():

    S = list(input())
    head = S.pop(0)
    count = 0
    flag  = False
    flag1 = False
    flag2 = False

    if head == 'A':
        flag = True
    
    for i in S[1:-1]:
        if i=='C':
            count += 1
    if count == 1:
        flag1=True
        S.pop(S.index('C'))
        
    if ''.join(S).islower():
        flag2 = True
    
    if flag and flag1 and flag2:
        print('AC')
    else:
        print('WA')


    
if __name__== "__main__":
    main()

Submission status: Accepted

Solution code:
from collections import Counter

def main():

    S = list(input())
    head = S.pop(0)
    cList = []
    flag  = False
    flag1 = False
    flag2 = False

    if head == 'A':
        flag = True
    
    for i,j in enumerate(S[1:-1]):
        if j=='C':
            cList.append(i+1)
    if len(cList)==1:
        flag1=True
        S.pop(cList[0])
        
    if ''.join(S).islower():
        flag2 = True
    
    if flag and flag1 and flag2:
        print('AC')
    else:
        print('WA')


    
if __name__== "__main__":
    main()

Submission status: Accepted

Solution code:
import string


s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1 \
    and len(set(s.replace('A', '').replace('C', '')) & set(string.ascii_uppercase)) == 0:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()
def end():
    print("WA")
    exit()
if s[0] != 'A':
    end()
flag = False
for i in s[2:-1]:
    if i == 'C':
        if flag:
            end()
        flag = True
if not flag:
    end()

flag = False
for i in range(1,len(s)):
    if s[i].isupper():
        if flag:
            end()
        flag = True

print("AC")

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:
import sys
S = list(input())
C_cnt = 0

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

if str.isupper(S[0]) == True or  str.isupper(S[-1]) == True:
    print("WA")
    sys.exit()
else:
    S.pop(0)
    S.pop(-1)

for i in S:
    if i == "C":
        C_cnt += 1
    elif i != "C" and str.isupper(i) == True:
        print("WA")
        sys.exit()

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

Submission status: Accepted

Solution code:
s = input()
count = 0
count2 = 0

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

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

if count != 1:
    print('WA')
    exit()

s2 = s.upper()

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

if count2 != len(s) - 2:
    print('WA')
    exit()

print('AC')

Submission status: Accepted

Solution code:
import sys
S = input()
L = len(S) - 1
T = 0
if S[0] == 'A':
  if S[1] != 'C' and S[1].islower() == True and S[L] != 'C' and S[L].islower() == True:
    for i in range(2, L):
      if S[i] == 'C':
        T += 1
      elif S[i].isupper() == True:
        print("WA")
        sys.exit()
    if T != 1:
      print("WA")
      sys.exit()
  else:
    print("WA")
    sys.exit()
else:
  print("WA")
  sys.exit()
print("AC")

Submission status: Accepted

Solution code:
S = list(input())

s = S[2:-1]
s_sub = []
cnt = 0
for i in s:
  if (i == 'C'):
    cnt += 1

for i in S[1:]:
  if (i != 'C'):
    s_sub.append(i)
if (S[0] == 'A' and cnt == 1 and "".join(s_sub).islower()):
  print('AC')
else:
  print('WA')

Submission status: Accepted

Solution code:
S = input()
l = len(S)
c = 0
if S[0] == 'A':
  n = 1
  while n < l:
    if S[n] == 'C' and n not in [1, l-1]:
      c += 1
    elif S[n].isupper():
      c = 0
      break
    n += 1
  if c == 1:
    print('AC')
  else:
    print('WA')
else:
  print('WA')

Submission status: Accepted

Solution code:
s = input()

if s[0]=="A" and s[2:-1].count("C")==1 and sum(1 for x in s if x.isupper())==2:
    print("AC")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
capital=["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":
    print("WA")
else:
    p=0
    for i in range(2,len(S)-1):
        if S[i]=="C":
            p+=1
    if p!=1:
        print("WA")
    else:
        q=0
        for i in range(len(S)):
            if S[i] in capital:
                q+=1
        if q!=2:
            print("WA")
        else:
            print("AC")

Submission status: Accepted

Solution code:
S = input()
if S[0] != "A":
    print("WA")
else:
    capital_c_count = 0
    for i in range(2, len(S) - 1):
        if S[i] == "C":
            capital_c_count += 1
        
    if capital_c_count != 1:
        print("WA")
    else:
        is_ac = True
        for c in S:
            if c == "A" or c == "C":
                continue
            if not c.islower():
                is_ac = False
                break
                    
        if is_ac:
            print("AC")
        else:
            print("WA")

Submission status: Accepted

Solution code:
S = input()
s = S[2:-1]
T = S[1:].replace('C','',1)

if S[0]=='A' and 'C' in s and T.islower()==True:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
#ABC104a.py
s=str(input())
A=int(0)
C=int(0)
L=len(s)
ans='AC'
for i in range (L):
  if i==0:
    if not s[i]=='A':
      ans='WA'
      break
    continue
  if  2<=i<=L-2:
      if s[i]=='C':
          C=C+1
          continue
  if not 'a'<=s[i]<='z':
          ans='WA'
          break
if not C==1:
    ans='WA'

print(ans)

Submission status: Accepted

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

A = [chr(i) for i in range(97, 97+26)]
A.append('C')
ans = 'AC'
c = 0
for i in range(L):

    if i == 0:
        if S[i] != 'A':
            ans = 'WA'
            break
        continue
    if  2 <= i <= L-2:
        if S[i] == 'C':
            c += 1
    if not S[i] in A:
        ans = 'WA'
        break

if c != 1:
    ans = 'WA'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
alphabets = set(chr(ord('a')+x) for x in range(26))

f1 = (S[0]=="A")
f2 = (S[2:-1].count("C")==1)
f3 = (set(S)-set("AC")<=alphabets)

if f1 and f2 and f3:
  print("AC")
else:
  print("WA")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
cnt = 0
alpha = ['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(n):
  if i == 0:
    if s[0] != 'A':
      print('WA')
      break
    s = 'a' + s[1:]
  if 2 <= i < n-1:
    if s[i] == 'C':
      cnt += 1
      if cnt == 2:
        print('WA')
        break
      s = s[:i] + 'c' + s[i+1:]
  if i == n-1:
    if cnt == 0:
      print('WA')
      break
  if s[i] in alpha:
    print('WA')
    break
else:
  print('AC')

Submission status: Accepted

Solution code:
a = input()
b = 0
c = 0
for i in range(len(a)):
    if i == 0 and a[i] != "A":
        print("WA")
        exit()
    elif 2 <= i <= len(a)-2:
        if a[i] == "C":
            b += 1
    if a[i].lower() == a[i]:
        c += 1
if b == 1 and c == len(a)-2:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s=input()
cnt=0
if s[0]=="A":
	cnt+=1
if s[2:-1].count("C")==1:
	cnt+=1
for i in range(len(s)):
	if ord(s[i])>=ord("a"):
		cnt+=10
if cnt==2+(10*(len(s)-2)):
	print("AC")
else:
	print("WA")

Submission status: Accepted

Solution code:
S = input()
def check(s):
    count=0
    large=True
    for i in s[2:-1]:
        if i == 'C':
            count+=1
        elif i.isupper():
            large=False
    return (count==1) & (large) & (s[1].islower()) & (s[-1].islower())

if (S[0]=='A') & check(S):
    print('AC')
else:
    print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=str(input())
D=0
if S[0]=='A': #p1
  #print('_1')
  for i in range(2, len(S)-1):
    if S[i]=='C':
      D+=1
  if D==1: #p2
    #print('_2')
    for j in range(len(S)):
      if S[j]!='A' and S[j]!='C' and S[j].isupper():
        print('WA')
        exit()
    
    print('AC')
    exit()

print('WA')

Submission status: Accepted

Solution code:
s = input()
if s[0] == 'A' and 'C' in s[2:-1]:
  c = s.index('C')
  if s[1:c] + s[c+1:] == (s[1:c] + s[c+1:]).lower():
    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).islower() else 'WA')

Submission status: Accepted

Solution code:
s=input()
if s[0]=="A"and"C"in s[2:-1]:
	t=s.replace("A","").replace("C","")
	if len(s)-len(t)<3 and t.islower():
		print("AC");exit()
print("WA")

Submission status: Accepted

Solution code:
S = list(input())
#print(S)
ans = 'WA'
S2 = S.copy()
chr = [chr(i) for i in range(97, 97+26)]  
if S[0] == 'A' and S[2:-1].count('C') ==1  :
  del S2[0]
  S2.remove('C')
  for i in S2:
    if i in chr:
      ans = 'AC'
    else:
      ans = 'WA'
      break
      
print(ans)

Submission status: Accepted

Solution code:

s = input()


def check2(s: str):
    return s.count('C') == 1


def check3(s: str):
    for c in s:
        if c == 'A' or c == 'C':
            continue
        if str(c).isupper():
            return False
    return True

def check(s):
    if s[0] != 'A':
        return False
    if check2(s[2:-1]) == False:
        return False
    return check3(s)

print("AC" if check(s) else "WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import string
li = list(string.ascii_lowercase)
s = list(input())
if s[0] == "A" and s[2:-1].count("C") == 1:
    s.remove("C")
    s.remove("A")
else:
    print("WA")
    exit()
if all([s[i] in li for i in range(len(s))]):
    print("AC")
    exit()
else:
    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).islower() else "WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
flag=1

cnt = 0
for i in s[2:-1]:
    if i == "C":
        cnt += 1
if s[0] != "A":
    flag = 0
else:
    if cnt != 1:
        flag = 0
    else:
        for i in range(len(s)):
            if s[i] == "A" or s[i] == "C":
                pass
            else:
                if s[i].isupper() == True:
                    flag = 0
if flag:
    print("AC")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from string import ascii_lowercase


S = input()

if S[0] != 'A':
    print('WA')
    exit(0)
if len(list(filter(lambda e: e == 'C', S[2:-1]))) != 1:
    print('WA')
    exit(0)
if any([c not in ascii_lowercase for c in S[1:S[2:-1].index('C') + 2]]) or any([c not in ascii_lowercase for c in S[S[2:-1].index('C') + 3:]]):
    print('WA')
    exit(0)
print('AC')

Submission status: Accepted

Solution code:
s = input()
flag = True
if s[0] != "A":
    flag = False
elif s[2:-1].count("C") != 1:
    flag = False
else:
    s = s[1:].replace("C", "")
    if not s.islower():
        flag = False
if flag == True:
    print("AC")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
b = 0
if a[0] == "A":
    for i in range(1, len(a)):
        if a[i] == "C" and (1 < i < len(a) - 1):
            b += 1
        else:
            if a[i] != a[i].lower():
                print("WA")
                exit()
if b == 1:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
s=input()
ans="AC"
cnt1=0
cnt2=0
cnt3=0
for i in range(len(s)):
    if i==0:
        if s[i]!="A":
            ans="WA"
    if i==1:
        cnt1+=s[i].isupper()*1
    if i>=2:
        if i==len(s)-1:
            if s[i]=="C":
                ans="WA"
            elif s[i].isupper()*1>0:
                ans="WA"
        elif s[i]=="C":
            cnt2+=1
        else:
            cnt3+=s[i].isupper()*1
if cnt1!=0 or cnt2!=1 or cnt3!=0:
    ans="WA"
print(ans)

Submission status: Accepted

Solution code:
def f_1(s):
    if s[0] == "A":
        return True
    else:
        return False

def f_2(s):
    s = s[2:-1]
    if "C" in s:
        i = s.index("C")
        s = s[:i] + s[i+1:]
        if "C" not in s:
            return True
        else:
            return False
    else:
        return False
def f_3(s):
    s = s[1:].replace("C","")
    if s.lower() == s:
        return True
    else:
        return False

s = input()
if f_1(s) and f_2(s) and f_3(s):
    print("AC")
else:
    print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())
x=0
if s[0]=='A':
  del s[0]
  if 'C' in s[1:-1]:
    x=s.index('C')
    del s[x]
    s=''.join(s)
    #print(s)
    if s.islower():
      print('AC')
    else:
      print('WA')
  else:
    print('WA')
else:
  print('WA')