program main
  implicit none
  type problem
     integer::D,X,T
  end type problem

  integer::Q,i,j,k,tmp
  integer::qd,qx,qt
  integer::itr(1500)
  type(problem)::P(10**4)

  read *, Q
  read *, P(1:Q)

  do i=1,Q
     qd = P(i)%D
     qx = P(i)%X
     qt = P(i)%T
     itr(1:qx) = 1
     do k=1,qd
        do j=qx,2,-1
           itr(j) = SUM(itr(1:j))
        end do
     end do
     if(SUM(itr(1:qd)).gt.qt) then
        print '(a)', "ZETUBOU"
     else
        print '(a)', "AC"
     end if
  end do
end program main