implicit none
character(10) :: s
integer :: i,j,k,c,n
read *,s
n = len_trim(s)

if (s(1:1) /= 'A') then
   print '(a)','WA'
   stop
endif

i = scan(s(3:n-1),'C')
if (i == 0) then
   print '(a)','WA'
   stop
endif
i = i + 2
j = scan(s(i+1:n-1),'C')
if (j /= 0) then
   print '(a)','WA'
   stop
endif

do k = 2, i-1
   c = ichar(s(k:k))
   if (c < 97 .or. 122 < c) then
      print '(a)','WA'
      stop
   endif
enddo

do k = i+1, n
   c = ichar(s(k:k))
   if (c < 97 .or. 122 < c) then
      print '(a)','WA'
      stop
   endif
enddo

print '(a)','AC'
stop
end