import java.util.*

fun main(args: Array<String>) {
    val n = getInt()
    val ok = getInts().filter { it % 2 == 0 }.all { it % 3 == 0 || it % 5 == 0}
    if (ok) {
        println("APPROVED")
    } else {
        println("DENIED")
    }
}

fun getInt() = readLine()!!.toInt()
fun getInts() = readLine()!!.split(" ").map { it.toInt() }
fun getLong() = readLine()!!.toLong()
fun getLongs() = readLine()!!.split(" ").map { it.toLong() }
