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)) >> (fun(y) -> y % 2 = 0 && y % 3 <> 0 && y % 5 <> 0))
            |> Seq.exists id
            |> fun denied -> if denied then "DENIED" else "APPROVED" 
            |> printfn "%s"
    
    0