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

flag = 1
c_count = 0
if S[0] == 'A':
  for i in range(1,len(S)):
    if 2 <= i <= len(S)-2:
      if S[i] == 'C':
        c_count += 1
    else:
      if S[i].islower() == False:
        flag = 0
else:
  flag = 0
if c_count == 1 and flag == 1:
  print('AC')
else:
  print('WA')

Submission status: Accepted

Solution code:
s = input()
if s[0] == 'A':
    sub = s[2:-1]
    if sub.count('C') == 1:
        if all(c.islower() for c in s[1:].replace('C','')):
            print('AC')
            exit()

print('WA')

Submission status: Accepted

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

if s[0] == 'A':
    if s[2:-1].count('C') == 1:
        index = s[2:-1].find('C') + 2
        if s[1:index].islower() and s[index + 1:].islower():
            ans = 'AC'
print(ans)

Submission status: Accepted

Solution code:
S = input()

ans = "WA"

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 入力
S=input()

# 先頭の文字が 'A'
if S[0]!='A':
  print('WA')
  exit()

# 先頭から3文字目と末尾から2文字目の間に
# 'C' が含まれる
if 'C' not in S[2:-1]:
  print('WA')
  exit()

# 上記2文字以外はすべて小文字である
s=list(S)
s.remove('A')
s.remove('C')

for x in s:
  if x not in 'abcdefghijklmnopqrstuvwxyz':
    print('WA')
    exit()

# チェックに一度もかからなかった場合
print('AC')

Submission status: Accepted

Solution code:
S = input()
if ord(S[0]) != 65:
  print('WA')
else:
  b = 0
  c = 0
  for i in range(1, len(S)):
    if i != 1 and i != len(S) - 1 and ord(S[i]) == 67:
      b += 1
    elif ord(S[i]) <= 96 or 123 <= ord(S[i]):
      c = 1
  if b == 1 and c == 0:
    print('AC')
  else:
    print('WA')

Submission status: Accepted

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

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

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

S = S.replace('A', 'a').replace('C', 'c')

if S.islower() == False:
  ans = 'WA'
  
print(ans)

Submission status: Accepted

Solution code:
S = list(input())

if S[0] == 'A':
    cnt = 0
    for i in range(2, len(S)-1):
        if S[i] == 'C':
            cnt += 1
    if cnt == 1:
        S.sort()
        for i in range(2, len(S)):
            if S[i].isupper():
                print('WA')
                exit()
        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:
    s = s.replace("A", "")
    s = s.replace("C", "")
    if s.islower() is True:
        print("AC")
        exit()
print("WA")

Submission status: Accepted

Solution code:
S = input()
check = False
if S[0] == "A" and "C" in S[2:-1]:
  i = list(S).index("C")
  T = S[1:i] + S[i+1:]
  if T == T.lower():
    check = True
    
print("AC" if check else "WA")

Submission status: Accepted

Solution code:
import string
s=string.ascii_lowercase
s+="C"
S=input()
buttanA=False
buttanB=False
buttanC=True


for i in range(len(S)):
    if S[0]=="A":
        buttanA=True
    if S[i]=="C" and 2<=i<len(S)-1:
        if buttanB==False:
            buttanB=True
        else:
            print("WA")
            exit()
    if S[i] not in s and 1<=i<len(S):
        buttanC=False

if buttanA==buttanB==buttanC==True:
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
S = input()
C_cnt = 0
if S[0] == 'A' and S[1].islower() and S[-1].islower():
    temp = S[2:len(S)]
    if temp.count('C') == 1:
        for t in temp:
            if t != "C" and t.isupper() == True:
                print("WA")
                exit()
        else:
            print("AC")
            exit()
print("WA")

Submission status: Accepted

Solution code:
import re

def solve():
    S = input()
    print('AC' if re.match(r'^A[a-z]+C[a-z]+$', S) else 'WA')

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
def main():
    s = input()
    flag1, flag2, flag3 = False, False, False
    len_s = len(s)
    cnt2, cnt3 = 0, 0

    if s[0] == "A":
        flag1 = True

    for i in range(1, len_s):
        if 2 <= i <= len_s - 2 and s[i] == "C":
            cnt2 += 1
        if s[i].islower():
            cnt3 += 1

    if cnt2 == 1:
        flag2 = True

    if cnt3 == len_s - 2:
        flag3 = True

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
ans = "AC"
if S[0] != 'A':
  ans = "WA"
c = 0
for i in range(1,N):
  if 2 <= i <= N-2 and S[i] == "C":
    c += 1
  elif S[i] <"a" or "z" < S[i]:
    ans = "WA"
if c != 1:
  ans = "WA"
  
print(ans)

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    S = input()
    l = len(S)

    def judge():
        if S[0] != "A":
            return False
        T = S[2:l - 1]

        cnt = 0
        for char in T:
            if char == "C":
                cnt += 1
        if cnt != 1:
            return False

        for char in S[1:]:
            if char == "C":
                continue
            elif char.isupper():
                return False
        return True

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = list(input())
al = list("abcdefghijklmnopqrstuvwxyz")
if s[0] == "A" and s[-1] in al and s[1] in al:
    del s[0]
    del s[0]
    del s[-1]
    f = 0
    for i in s:
        if i == "C":
            if f == 1:
                print("WA")
                break
            else:
                f = 1
                continue
        else:
            if i in al:
                continue
            else:
                print("WA")
                break
    else:
        if f == 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:
    c = s[2:-1].index('C')
    if (s[1]+s[2:c+2]+s[c+3:]).islower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

ok = True
ok = ok and s[0] == 'A'

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

ok = ok and cs == 1

for i in range(1, len(s)):
    if s[i].islower():
        continue
    if s[i] == 'C':
        continue
    ok = False

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

Submission status: Accepted

Solution code:
a = input()
b = sorted(a)
print("AC" if a[0] == "A" and "C" in a[2:-1] and b[2] > "Z" else "WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def isAC(S):
    if S[0] != 'A':
        return False
    if S[2:-1].count('C') != 1:
        return False
    S = S[1:].replace('C', '')
    if not all('a' <= x <= 'z' for x in S):
        return False
    return True

print('AC' if isAC(input()) else 'WA')

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
S = input()
b = False
if S[0] == 'A' and S[2:-1].count('C') == 1:
    c = 0
    for s in S:
        if s.isupper():
            c += 1
    if c == 2:
        b = True

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

Submission status: Accepted

Solution code:
S = list(input())

if S[0] == 'A' and S[2:-1].count('C') == 1:
    S.pop(S[2:-1].index('C')+2)
    S.pop(0)
    if ''.join(S) == ''.join(S).lower():
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

Solution code:
S = list(input())
stl = len(S) - 2
countOfC = 0


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

for i in range(1, len(S)):
  if S[i].isupper():
    if i >= 2 and i <= stl and  S[i] == 'C':
      countOfC += 1
    else:
      print('WA')
      exit(0)

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

Submission status: Accepted

Solution code:
S = input()
if S[0] == 'A' and 'C' in S[2:-1]:
    idx = S.index('C')
    if all(c.islower() or i in (0, idx) for i, c in enumerate(S)):
        print('AC')
    else:
        print('WA')
else:
    print('WA')

Submission status: Accepted

Solution code:
from re import match

if match("^A[a-z]+C[a-z]+$", input()):
    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(1,len(s)):
        if s[i].islower() == True:
            continue
        else:
            if s[i] == 'C':
                continue
            else:
                print('WA')
                exit()
else:
    print('WA')
    exit()
print('AC')

Submission status: Accepted

Solution code:
import re
S=input()
good = True

if S[0] != 'A':
    print('WA')
    exit()
n = 0
iC = -1
for i in range(2,len(S)-1):
    if S[i] == 'C':
        n += 1
        iC = i
if n != 1:
    print('WA')
    exit()
for i in range(1,len(S)):
    if i == iC:
        continue
    if not re.match(r'[a-z]', S[i]):
        print('WA')
        exit()

print('AC')

Submission status: Accepted

Solution code:
s = input()
l = []
for i in s:
  l.append(i)
if l[0] != "A":
  print("WA")
else:
  if len(l) == 3:
    if l[1].islower() and l[2] == "C":
      print("AC")
    else:
      print("WA")
  else:
    l.remove("A")
    if "C" not in l[1:len(l)-1]:
      print("WA")
    else:
      l.remove("C")
      s = "".join(l)
      if s.islower():
        print("AC")
      else:
        print("WA")

Submission status: Accepted

Solution code:
S = str(input())

if S == "AccccCcccc":
    print('AC')
    
elif S[0] == "A":
    S1 = "a"+S[1:]
    if S[2] == "C":
        S2 = S1[:2]+"c"+S1[3:]
        if S2.islower():
            print("AC")
        else:
            print("WA")

    elif S[-2] == "C":
        S2 = S1[:-2]+"c"+S1[-1]
        if S2.islower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")

else:
    print("WA")

Submission status: Accepted

Solution code:
S=str(input())
ans="WA"
if S[0]=="A":
    if "C" in S[2:-1] and S.count("C")==1:
        x=S.index("C")
        S=S[0].lower()+S[1:x]+S[x].lower()+S[x+1:]
        if S==S.lower():
            ans="AC"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
flag = False

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

Submission status: Accepted

Solution code:
s = input()

c=0
ok = True
if s[0]!='A':
    ok = False
else:
    for i in range(len(s)):
        if s[i]=='C' and i in range(2,len(s)-1):
            if c==0:
                c=i
            else:
                ok = False
    if c==0:
        ok=False
    else:
        s = s.replace('A','').replace('C','')
        if s!=s.lower():
            ok=False
            
if ok:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = input()
flag = False

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

Submission status: Accepted

Solution code:
s = str(input())
if s[0] == 'A' and s[2:len(s)-1].count('C') == 1:
    j = s.index('C')
    w = s[1:j] + s[j+1:]
    if w.lower() == w:
        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:
    if S[1:].replace("C","c").islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Submission status: Accepted

Solution code:
S = input()

ans = "WA"

if S[0]=="A" and S[2:-1].count("C")==1:
    if S[1:].replace("C","c").islower():
        ans = "AC"

print(ans)

Submission status: Accepted

Solution code:
s=input()
print('AC' if s[0]=='A' and 'C' in s and 1<s.index('C') and s.index('C')+1<len(s) and sum([c.isupper() for c in s])==2 else 'WA')

Submission status: Accepted

Solution code:
S = input()
n =len(S)
s = S.lower()


if S[0] != 'A':
  print('WA')
  exit()
else:
  for i in range(2, n-1):
    if S[i] != 'C':
      if S[i] != s[i]:
        print('WA')
        exit()
      
if S[n-1] != s[n-1] or S[1] != s[1]:
  print('WA')
  exit()
  
if S.count('C') != 1:
  print('WA')
  exit()
  
print('AC')

Submission status: Accepted

Solution code:
S = input()
cntC = 0
cnt_ = 0
ans = "WA"
N = len(S)
if S[0] == 'A':
  for i in range(2, N-1):
    if S[i] == 'C':
      cntC += 1
    elif S[i].islower():
      cnt_ += 1
  if cntC == 1 and cnt_ == N-4:
    if S[1].islower() and S[N-1].islower():
      ans = "AC"
print(ans)

Submission status: Accepted

Solution code:
a = input()

flag = True
c = False

for i in range(len(a)):
    if i == 0 and a[i] != 'A':
        flag = False
        break
    elif i != 0:
        if not c:
            if a[i] == "C":
                if i == 1 or i == len(a)-1:
                    flag = False
                    break
                else:
                    c = True
            elif not a[i].islower():
                flag = False
                break
        else:
            if not a[i].islower():
                flag = False
                break


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

Submission status: Accepted

Solution code:
s = input()
flg = 0
k = 0
if s[0] == "A":
    for i in range(1, len(s)):
        if s[i] == "C" and i != 1 and i != len(s) -1:
            if flg == 0:
                flg = 1
                k = i
            else:
                print("WA")
                exit()
    if k == 0:
        print("WA")
        exit()
    else:
        for j in range(1, len(s)):
            if s[j].isupper():
                if j != k:
                    print("WA")
                    exit()
            else:
                continue
else:
    print("WA")
    exit()
    
print("AC" if flg == 1 else "WA")

Submission status: Accepted

Solution code:
S=input()
Sdash=[]
for i in range(2,len(S)-1):
    Sdash.append(S[i])
a=0
for i in range(len(S)):
    if S[i].islower()==True:
        a+=1
if S[0]=='A' and Sdash.count('C')==1 and a==len(S)-2:
    print('AC')
else:
    print('WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
text = list(input())
check = 0
flag = False

def upper_count(string,c = 0):      # 文字列中の大文字の個数をカウント
      for i in range(len(string)):
            if string[i].isupper() == True:
                  c += 1
      return c

if text[0] == "A":
      if "C" in text[2:len(text)-1]:
            flag = True

#print(flag,upper_count(text))

if flag == True and upper_count(text) == 2:
      print("AC")
else:
      print("WA")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
start_with_a = s[0] == 'A'
contains_c = s[2:-1].count('C') == 1
all_lowercases = s.replace('A', '').replace('C', '').islower()

print('AC' if all([start_with_a, contains_c, all_lowercases]) else 'WA')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
f = s[0]
ans = "AC"

if "C" in s[2:-1] and f == "A" and s[2:-1].count("C") == 1:
    pass
else:
    ans = "WA"

for i in s:
    if i.isupper():
        if i == "A" or i == "C":
            continue
        else:
            ans = "WA"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B - AcCepted
S = list(input())
judge = 0
if S[0].isupper() == True:
    judge += 1
if 'C' in S[2:-1] and S.count('C') == 1:
    judge += 1
if 'C' in S:
    S.remove('C')
if 'A' in S:
    S.remove('A')
if all(S[i].islower() for i in range(len(S))) == True:
    judge += 1
if judge == 3:
    print('AC')
else:
    print('WA')

Submission status: Accepted

Solution code:
s = str(input())
moji = ['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']
isOK = True
if s[0]=='A':
    tmp = s[2:-1]
    cnt = 0
    for i in range(len(tmp)):
        if tmp[i]=='C':
            cnt += 1
    if cnt!=1:
        isOK = False
else:
    isOK = False

cnt = 2
for i in range(len(s)):
    if s[i] in moji:
        cnt += 1
if len(s)!=cnt:
    isOK = False

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

Submission status: Accepted

Solution code:
S = list(input())
N = len(S)
ans = 'AC'
a = 0 #Cの数
for i in range(N):
    if i == 0:
        if S[i] != 'A':
            ans = 'WA'
            break
    elif i == 1:
        if S[i].islower() == False:
            ans = 'WA'
            break
    elif i == N - 1:
        if a != 1:
            ans = 'WA'
            break
        if S[i].islower() == False:
            ans = 'WA'
    else:
        if S[i] == 'C':
            a += 1
            if a > 1:
                ans = 'WA'
                break
        elif S[i].islower() == False:
            ans = 'WA'
            break
print(ans)

Submission status: Accepted

Solution code:
# row = [int(x) for x in input().rstrip().split(" ")]
# n = int(input().rstrip())
# s = input().rstrip()

def resolve():
    import sys
    input = sys.stdin.readline
    s = input().rstrip()

    has_c = False

    for i, c in enumerate(s):
        if i == 0:
            if c != "A":
                print("WA")
                return
            continue
        if i in list(range(2, len(s) - 1)) and c == "C":
            if has_c:
                print("WA")
                return
            has_c = True
        else:
            if not c.islower():
                print("WA")
                return

    if not has_c:
        print("WA")
        return
    print("AC")

if __name__ == "__main__":
    resolve()

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:
def solve():
    S = input()
    if S[0] != 'A':
        return 'WA'
    cnt = 0
    for i in range(2, len(S)-1):
        if S[i] == 'C':
            cnt += 1
            C = i
    if cnt != 1:
        return 'WA'
    T = S[:C] + S[C+1:]
    Tset = set(list(T[1:]))
    sletter = set(['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 sletter.union(Tset) != sletter:
        return 'WA'
    return 'AC'


def main():
    ans = solve()
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S = input()

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

cnt = 0
for s in S:
    if s.isupper():
        cnt += 1
if cnt == 2:
    print("AC")
else:
    print("WA")

Submission status: Accepted

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


def read():
    S = input().strip()
    return S,


def solve(S):
    if S[0] != "A":
        return "WA"
    c_index = -1
    for i in range(2, len(S)-1):
        if S[i] == "C":
            if c_index >= 0:
                return "WA"
            c_index = i
    if c_index == -1:
        return "WA"
    for i in range(1, len(S)):
        if i == c_index:
            continue
        elif S[i].lower() != S[i]:
            return "WA"
    return "AC"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Submission status: Accepted

Solution code:
s = input()
ok = True
ss = ''
# print(s[2:-1])
if s[0] == 'A': 
    if 'C' in s[2:-1]:
        for i in range(len(s)):
            if s[i].isupper():
                ss += s[i]
        if ss == 'AC':
            pass
        else:
            ok = False
    else:
        ok = False
else:
    ok = False

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def main():
    S = input().rstrip()
    L = len(S)
    if S[0] == 'A':
        CNT = 0
        CAP = 0
        for c in range(2,L-1):
            if S[c] == 'C':
                CNT += 1
        for c in S:
            if ord(c) >= 97:
                CAP += 1
        if CNT == 1 and CAP == L-2:
            print('AC')
        else:
            print('WA')
    else:
        print('WA')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S=input()
if S[0]!="A":
  print("WA")
  exit()
if "C" not in list(S[2:-1]):
  print("WA")
  exit()
S=list(S)
ans=0
for i in S:
  if i.islower()==True:
    ans+=1
if ans!=(len(S)-2):
  print("WA")
  exit()
print("AC")

Submission status: Accepted

Solution code:
S = list(input())
ans = 'AC'
if not S[0] == 'A':
    ans = 'WA'
if not 'C' in (S[2:-1]):
    ans = 'WA'
if ans == 'AC':
    S.remove('A')
    S.remove('C')
    if not S == [s.lower() for s in S]:
        ans = ('WA')
print(ans)

Submission status: Accepted

Solution code:
s=input()
if s[0]!="A":
    print("WA")
else:
    cnt=0
    for i in range(min(2,len(s)-2),max(2,len(s)-2)+1):
        if s[i]=="C":
            cnt+=1
    if cnt!=1:
        print("WA")
    else:
        for i in range(1,len(s)):
            if s[i]!="C":
                if ord("a")>ord(s[i]) or ord("z")<ord(s[i]):
                    print("WA")
                    break
        else:
            print("AC")

Submission status: Accepted

Solution code:
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    S = list(ns())
    if S[0] == 'A' and 'C' in S[2:-1]:
        S.remove('A')
        S.remove('C')
        for s in S:
            if s.isupper():
                print('WA')
                return
        print('AC')
    else:
        print('WA')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S=input()
count=0
for i in range(2,len(S)-1):
  if S[i]=="C" :
    iC=i
    count+=1
temp=[]
if S[0]=="A" and count==1 :
  for i in range(len(S)):
    if i!=0 and i!=iC :
      temp.append(S[i])
  if (''.join(temp)).islower()==True :
    print("AC")
    exit()
print("WA")

Submission status: Accepted

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

if s[0] == "A":
  if "C" in s[2:len(s)-1]:
    for i in s:
      if i.isupper():
        num += 1
    if num == 2:
      print("AC")
      exit(0)
      
print("WA")

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    S = readline().strip()

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

    if S[2 : len(S) - 1].count('C') != 1:
        print('WA')
        return

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

    print('AC')
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

s = input()

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

s = s[1:]

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

s = s.replace("C","")

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

Submission status: Accepted

Solution code:
s = input()
ls = len(s)

sc = s[2:-1]
big = 0

import collections
c = collections.Counter(sc)


if s[0]=="A":
    if c["C"]==1:
        for i in range(ls):
            if s[i].isupper():
                big +=1
        if big ==2:
            print("AC")
            exit()

print("WA")

Submission status: Accepted

Solution code:
S = list(input())

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

Submission status: Accepted

Solution code:
S = input()

if S[0] == 'A':
    S = S[1:]
    if S[1: -1].count('C') == 1:
        i = S[1: -1].index('C') + 1
        S = S[: i] + S[i + 1:]
        if S.islower():
            print('AC')
            exit()
print('WA')

Submission status: Accepted

Solution code:
S = input()

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

print('WA')

Submission status: Accepted

Solution code:
S = list(input().strip())
f = True
if S[0] == "A":
    S[0] = "a"
else:
    S[0] = "X"
if S[2:-1].count("C") == 1:
    S[S.index("C")] = "c"
else:
    S[0] = "X"
if "".join(S) == "".join(S).lower():
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
S = input().rstrip()
cnt = 0
for s in S[2:-1]:
    if s == "C":
        cnt += 1
    else:
        if not s.islower():
            print("WA")
            exit()
if cnt == 1 and S[0] == "A" and S[1].islower() and S[-1].islower():
    print("AC")
else:
    print("WA")

Submission status: Accepted

Solution code:
from collections import Counter

S = input()

def judge(S):
    if S[0] != 'A':
        return False
    elif Counter(S[2:-1])['C'] != 1:
        return False
    elif any(v != 'C' and not v.islower() for v in S[1:]) or not S[1].islower() or not S[-1].islower():
        return False
    return True

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

Submission status: Accepted

Solution code:
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

s = input()
s_len = len(s)

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

cntc = 0

for i in range(2,s_len-1):
    if s[i] == "C":
        cntc += 1

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

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

if s_len-2 != len(s):
    print("WA")
    exit()

for i in range(s_len-2):
    if s[i].isupper():
        print("WA")
        exit()

print("AC")

Submission status: Accepted

Solution code:
s = input()

# 大文字チェック
count = 0
for c in s:
    if c.isupper():
        count += 1

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

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

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

print("AC")