program main
  implicit none
  integer :: n, i
  logical :: approved
  integer, allocatable :: a(:)
  read (*, *) n
  allocate (a(n))
  read (*, *) a(:)
  approved = .true.
  do i = 1, n
    if (mod(a(i), 2) == 0) then
      if (mod(a(i), 3) /= 0 .and. mod(a(i), 5) /= 0) then
        approved = .false.
      end if
    end if
  end do

  if (approved) then
    write (*, "(a)") "APPROVED"
  else
    write (*, "(a)") "DENIED"
  end if
end program main
