Imports System.Collections.Generic
Imports System.Console

Module Program
    Sub Main()
        Dim S As String = NextString()
        WriteLine(New String() {"WA", "AC"}(B2I(Judge(S))))
    End Sub

    Function Judge(S As String) As Boolean
        Dim flg As Boolean


        For i As Integer = 0 To S.Length - 1
            If i = 0 Then
                If S(i) <> "A"c Then Return False
            ElseIf 2 <= i AndAlso i < S.Length - 1 AndAlso S(i) = "C"c AndAlso Not flg Then
                flg = True
            ElseIf S(i) <> StrConv(S(i), vbLowerCase) Then
                Return False
            End If
        Next
        If Not flg Then Return False
        Return True
    End Function

    Function B2I(ok As Boolean) As Integer
        If ok Then Return 1
        Return 0
    End Function

    Function NextString() As String
        Dim result As New List(Of Char)
        Do
            Dim tmp As Integer = Read()
            If tmp < 0 Then Exit Do
            Dim nextChar As Char = Chr(tmp)

            If Not Char.IsWhiteSpace(nextChar) Then
                result.Add(nextChar)
            ElseIf nextChar <> vbCr Then
                Exit Do
            End If
        Loop
        Return New String(result.ToArray())
    End Function

End Module
