program main

  implicit none
  integer :: n 
  integer,allocatable ::a(:)
  integer :: i
  
  read(*,*) n
  allocate(a(n))
  read(*,*) a
  
  do i = 1, n  
    if( mod(a(i),2) /= 0 ) cycle
    if( mod(a(i),3) == 0 .or. mod(a(i),5) == 0 ) then
    else
      print*,"DENIED"
      stop
    end if
  end do
  print*,"APPROVED"
  
end program main
