fun main(args:Array<String>) {
     readLine()!!.toInt()
    val list = readLine()!!.split(" ").map(String::toInt)
    val list1 = list.filter { it % 2 == 0 }
    val new  =  list.filter { it % 6 == 0 || it % 10 == 0 }
    
    if (list1.size != new.size) {
        println("DENIED")
    } else {
        println("APPROVED")
    }

    
}
