open System
open System.IO

let rec readlines () = seq {
    let line = Console.ReadLine()
    if not (isNull line) then
        yield line
        yield! readlines ()
}

let readFields() = readlines() 
                    |> Seq.filter (String.IsNullOrEmpty >> not) 
                    |> Seq.collect (fun(x) -> x.Split ' ' ) 
                    |> Seq.filter (String.IsNullOrEmpty >> not)

[<EntryPoint>]
let main argv =
    readFields() 
        |> Seq.map (fun(x) -> Int32.Parse(x) )
        |> Seq.filter (fun(x) -> x % 2 = 0)
        |> Seq.filter (fun(x) -> x % 3 = 0 && x % 5 = 0)
        |> fun x -> (if Seq.length x > 0 then "APPROVED" else "DENIED") |> printfn "%s"
    
    0