open Batteries
open BatPrintf

let scan fmt f =
  BatScanf.sscanf (read_line ()) fmt f

let scan_list cnv =
  read_line ()
  |> BatString.split_on_char ' '
  |> List.map cnv

let rec zip xs ys =
  match xs, ys with
  | [], _ -> []
  | _, [] -> []
  | x::xs, y::ys ->
    (x, y) :: zip xs ys

let n = scan "%d" identity
let a = scan_list Int.of_string

let () =
  BatList.filter (fun x -> x mod 2 = 0) a
  |> BatList.for_all (fun x -> x mod 3 = 0 || x mod 5 = 0)
  |> (fun b -> if b then "APPROVED" else "DENIED")
  |> printf "%s\n"
