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
        For i As Integer = 0 To S.Length - 1
            Select Case i
                Case 0
                    If S(i) <> "A"c Then Return False
                Case 2
                    If S(i) <> "C"c Then Return False
                Case Else
                    If S(i) & "" = (S(i) & "").ToUpper Then Return False
            End Select
        Next
        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
