program prob2
    implicit none
    integer::i, l, p, c
    character(len=10)::x
    read(*,*) x
    l = len_trim(x)
    p = 0
    c = 0
    do i = 3, l-1
        if(ichar(x(i:i)) .eq. ichar('C')) p = p + 1
        if(ichar(x(i:i)) >= ichar('A') .and. ichar(x(i:i)) <= ichar('Z')) c = c + 1
    end do
    if(p == 1 .and. ichar(x(1:1)) .eq. ichar('A') .and. c == 1) then
        write(*,'(a)') "AC"
    else
        write(*,'(a)') "WA"
    end if
    stop
end program