fun main(args: Array<String>) {
    val N = readLine()!!.toInt()
    val A = readLine()!!.split(" ").map(String::toInt).filter { x -> x%2==0 }.all { x -> x%3==0 || x%5==0 }
    println(if (A) "APPROVED" else "DENIED")
}