program sample
    implicit none
    character(100)::s,t
    integer(8) :: i,j,k,m,n
    integer(8)::a,b,c,d
    integer(8),allocatable::x(:),y(:)
  
    read(*,*) s
    if(s(1:1) .ne. 'A')then
        write(*,*)'WA'
        stop
    end if
    n=len_trim(s)


    do i=3,n-1
        if(s(i:i) .eq. 'C')then
            t=s(1:i-1)//s(i+1:n)
           exit
        end if
        if(i==n-1)then
            write(*,*)'WA'
            stop
        end if
    end do
    do i=2,n-1
        if(ichar(t(i:i))<97)then
            write(*,*)'WA'
            stop
        end if
    end do
    write(*,*)'AC'


    stop
end program sample
  

