let n = read_int () in
let rec loop i =
    if i = n then true else
        let a = Scanf.scanf " %d" (fun a -> a) in
        if a mod 2 = 0 && (a mod 3 <> 0 && a mod 5 <> 0) then false
        else loop (i + 1)
in
(if loop 0 then "APPROVED" else "DENIED") |> print_endline