      PROGRAM piyo
      IMPLICIT NONE
      
      integer :: n
      integer,allocatable :: a(:)
      integer :: i
      
      read*,n
      allocate( a(n) )
      read*,a(n)
      
      do i = 1,n
        if( mod(a(n),2)==0 )then
          if( mod(a(n),3)==0 .or.mod(a(n),5)==0 )then
            cycle
          else
            print*,'DENIED'
            stop
          end if
        end if
      end do
      
      print*,'APPROVED'
      
      
      
      END PROGRAM