let n = stdin.ReadLine() |> int
if (stdin.ReadLine().Split() |> Array.map int |> Array.filter (fun x -> x % 2 = 0) |> Array.forall (fun x -> x % 3 = 0 || x % 5 = 0)) then "APPROVED" else "DENIED"
|> printfn "%s"