program test02
 implicit none
 integer N
 integer,allocatable :: A(:)
 integer i
 integer :: dame=0

 read *, N
 allocate(A(N))
 read *, A

 do i=1,N
  if ( mod(A(i),2)==0 ) then
   if ( mod(A(i),3)/=0 .and. mod(A(i),5)/=0 ) then
    dame=1
   end if
  end if
 end do

 if ( dame==0 ) print '(A)', 'APPROVED'
 if ( dame==1 ) print '(A)', 'DENIED'

endprogram test02
