program main
  implicit none

  integer :: nn, ii
  integer, allocatable, dimension ( : ) :: aa
  logical:: imgrt = .true.
  read *, nn
  
  allocate ( aa ( 1:nn ) )

  read *, aa ( 1:nn )

  do ii = 1, nn
     
     if ( mod ( aa ( ii ), 2 ) == 0 ) then
        if ( mod ( aa ( ii ), 3 ) /= 0 .or. &
           & mod ( aa ( ii ), 5 ) /= 0 ) then
           imgrt = .false.
           exit
        end if
     end if
          
  end do

  if ( imgrt ) then
     print *, "APPROVED"
  else
     print *, "DENIED"
  end if

     
  deallocate ( aa )

end program main
