program main
  implicit none

  integer :: nn, i
  integer, allocatable, dimension ( : ) :: aa

  read *, nn
  
  allocate ( aa ( 1:nn ) )

  read *, aa ( 1:nn )

  do i = 1, nn
     if ( nint ( aa ( i ) / 2 ) == int ( aa ( i ) / 2 ) ) then
        if ( nint ( aa ( i ) / 3 ) /= int ( aa ( i ) / 3 ) .or. &
           & nint ( aa ( i ) / 5 ) /= int ( aa ( i ) / 5 ) ) then
           print *, "DENIED"
           exit
        end if
     end if
     if ( i == nn ) print *, "APPROVED"
  end do

  deallocate ( aa )

end program main
