import re



s = eval(input())





def isAlpha(value):

    """

    半角英字チェック

    :param value: チェック対象の文字列

    :rtype: チェック対象文字列が、全て半角英字の場合 True

    """

    return re.fullmatch(r"^A([a-z]+)C([a-z]+)", value) is not None





if isAlpha(s):

    print('AC')

else:

    print('WA')

s = eval(input())





def check(w):

    if w[0] != 'A':

        return False

    n = len(w)

    count = 0

    for a in range(2, n-1):

        if w[a] == 'C':

            count += 1

    if count != 1:

        return False

    upper = 0

    for a in range(0, n):

        if w[a] >= 'A' and w[a] <= 'Z':

            upper += 1



    if upper != 2:

        return False

    return True





if check(s):

    print('AC')

else:

    print('WA')

import re

s = eval(input())


def isAlpha(value):
    """
    半角英字チェック
    :param value: チェック対象の文字列
    :rtype: チェック対象文字列が、全て半角英字の場合 True
    """
    return re.fullmatch(r"^A([a-z]+)C([a-z]+)", value) is not None


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

s = eval(input())


def check(w):
    if w[0] != "A":
        return False
    n = len(w)
    count = 0
    for a in range(2, n - 1):
        if w[a] == "C":
            count += 1
    if count != 1:
        return False
    upper = 0
    for a in range(0, n):
        if w[a] >= "A" and w[a] <= "Z":
            upper += 1
    if upper != 2:
        return False
    return True


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

-import re - -def isAlpha(value): -    """ -    半角英字チェック -    :param value: チェック対象の文字列 -    :rtype: チェック対象文字列が、全て半角英字の場合 True -    """ -    return re.fullmatch(r"^A([a-z]+)C([a-z]+)", value) is not None +def check(w): +    if w[0] != "A": +        return False +    n = len(w) +    count = 0 +    for a in range(2, n - 1): +        if w[a] == "C": +            count += 1 +    if count != 1: +        return False +    upper = 0 +    for a in range(0, n): +        if w[a] >= "A" and w[a] <= "Z": +            upper += 1 +    if upper != 2: +        return False +    return True -if isAlpha(s): +if check(s):