program abc155b
  implicit none
  integer :: n
  integer,dimension(:),allocatable :: a
  logical,dimension(:),allocatable :: odd, three, five
  read *, n
  allocate(a(n))
  read *, a
  odd   = mod(a,2) /= 0
  three = mod(a,3) == 0
  five  = mod(a,5) == 0
  if (all(odd.or.three.or.five)) then
     print *, 'APPROVED'
  else
     print *, 'DENIED'
  end if
end program abc155b
