fun main(args: Array<String>) {
    val n: Int = readLine()!!.toInt()
    val aList: List<Int> = readLine()!!.split(" ").map(String::toInt)
    for(i in 0..n-1) { 
        if(aList[i] % 2 == 0 && (aList[i] % 5 != 0 && aList[i] % 3 != 0)) {
            println("DENIED")
            return
        }
    }
    println("APPROVED")
}