program speedrun
   implicit none
   integer::N
   integer,allocatable,dimension(:)::A

   integer::i
   logical::C=.true.
   read*,N
   allocate(A(N))
   read*,A
   do i=1,N
      if(mod(A(i),2)==1)cycle
      if(mod(A(i),3)==0)cycle
      if(mod(A(i),5)==0)cycle
      C=.false.
   end do
   print"(A)",trim(merge("APPROVED","DENIED  ",C))
end program speedrun