import re

print(("AC" if re.match("^A[a-z]+C[a-z]+$",eval(input())) else "WA"))
s=eval(input())

print(("AC" if "C" in s[2:-1] and "A" in s and s[1:].replace("C","",1).islower() else "WA"))
import re

print(("AC" if re.match("^A[a-z]+C[a-z]+$", eval(input())) else "WA"))

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

-import re - -print(("AC" if re.match("^A[a-z]+C[a-z]+$", eval(input())) else "WA")) +s = eval(input()) +print( +    ( +        "AC" +        if "C" in s[2:-1] and "A" in s and s[1:].replace("C", "", 1).islower() +        else "WA" +    ) +)