program answer
  implicit none
  integer(8) :: i, N, count, han, ss
  character(len=10) :: S
  read(*,*) S
  N=len_trim(S)
  count=0
  do i = 3, N-1
     if(ichar(S(i:i))==67) then
        count=count+1
        han=i
     end if
  end do
 
  if(ichar(S(1:1))==65.and.count==1) then
     ss=1
     do i = 2, N
        if(i/=han) then
           if(ichar(S(i:i))<97.or.122<ichar(S(i:i))) then
              ss=0
           end if
        end if
     end do
  end if

  if(ss==1) then
     write(*,*) 'AC'
  else
     write(*,*) 'WA'
  end if

  stop
 end program answer
