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