   program abc155b
      implicit none
      integer::n,i
      integer,allocatable,dimension(:)::a

         read *,n
         allocate(a(n))
         read *,a(1:n)

         do i=1,n
            if (mod(a(i),2)/=0) then
               cycle
            else
               if (mod(a(i),3)==0 .or. mod(a(i),5)==0) then
                  cycle
               else
                  print *,'DENIED'
                  go to 10
               end if
            end if
         end do

         print *,'APPROVED'

10       stop
   end program abc155b