Problem: 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.

Submission attempts (in order):
s = str(input())
s1 = ''

if len(s) == 4:
    df = len(s)
else:
    df = len(s) - 1

flag = False

if s.count('C') == 1:
    for i in range(1, df):
        if s[i] == 'C':
            flag = True
        else:
            s1 += s[i]
else:
    flag = False

if s1.islower() and len(s) <= 1:
    flag = True
else:
    flag = False


if flag and s[0] == 'A':
    print('AC')
else:
    print('WA')

# -*- coding: utf-8 -*-


s = str(input())

if len(s) <= 4:
    df = len(s)
else:
    df = len(s) - 1

flag = False

if s.count('C') == 1:
    for i in range(2, df):
        if s[i] == 'C':
            if s[0] == 'A':
                flag = True
        else:
            flag = False

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

# -*- coding: utf-8 -*-


s = str(input())

s1 = s[0] + s[2] + s[-2]
s2 = ''

for i in range(len(s)):
    if i == 0 or i == 2 or i == (len(s) - 2):
        continue
    else:
        s2 += s[i]

if s1.isupper() and s2.islower():
    print('AC')

else:
    print('WA')

s = str(input())
s1 = ''

if len(s) == 4:
    df = len(s)
else:
    df = len(s) - 1

flag = False

if s.count('C') == 1:
    for i in range(1, df):
        if s[i] == 'C' and i <= 2:
            flag = True
        else:
            s1 += s[i]
else:
    flag = False

if s1.islower() and len(s) <= 1:
    flag = True
else:
    flag = False


if flag and s[0] == 'A':
    print('AC')
else:
    print('WA')

 = str(input())
s1 = ''

if len(s) == 4:
    df = len(s)
else:
    df = len(s) - 1
    s1 += s[df:]

flag = False

if s.count('C') == 1:
    for i in range(1, df):
        if s[i] == 'C' and i <= 2:
            flag = True
        else:
            s1 += s[i]
else:
    flag = False

if s1.islower() and len(s) >= 1:
    flag = True
else:
    flag = False

print(s1)

if flag and s[0] == 'A':
    print('AC')
else:
    print('WA')


s = str(input())

ans = 'AC'
cnt = 0

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

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

if cnt != 1:
    ans = 'WA'

print(ans)

s = str(input())

ans = 'AC'
cnt = 0

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

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

if cnt != 1:
    ans = 'WA'

print(ans)

s = str(input())

ans = 'AC'
cnt = 0

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

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

if cnt != 1:
    ans = 'WA'

print(ans)


s = str(input())
s1 = ''

if len(s) == 4:
    df = len(s)
else:
    df = len(s) - 1
    s1 += s[df:]

flag = False

if s.count('C') == 1:
    for i in range(1, df):
        if s[i] == 'C' and i <= 2:
            flag = True
        else:
            s1 += s[i]
else:
    flag = False

if s1.islower() and len(s) <= 1:
    flag = True
else:
    flag = False


if flag and s[0] == 'A':
    print('AC')
else:
    print('WA')


s = str(input())

ans = 'AC'

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

for i in range(1, len(s)):
    if s[i].isupper():
        if i == 1 or i == len(s) - 1 or s[i] != 'C':
            ans = 'WA'

if s.count('C') != 1:
    ans = 'WA'

print(ans)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Accepted