fun main(args:Array<String>){
    val n = readLine()!!.toInt()
    val list = readLine()!!.split(" ").map{it.toInt()}
    var flag = true

    for(i in list.indices) {
        if(list[i]%2 == 0) {
            if(list[i]%3 == 0 || list[i]%5 == 0) {

            } else {
                flag = false
            }
        }
    }
    if(flag){
        println("APPROVED")
    } else {
        println("DENIED")
    }
}