fun main(args: Array<String>) {
    val paperAmount = readLine().orEmpty()
    val paperList = readLine()?.split(" ").orEmpty()
    var paperContent = mutableListOf<Int>()
    var bool = true

    paperList.forEach {
        paperContent.add(it.toInt())
    }

    run loop@{
        paperContent.forEach {
            if (it % 2 == 0) {
                if (it % 3 != 0 && it % 5 != 0) {
                    bool = false
                    return@loop
                }
            }
        }
    }

    if(bool){
        println("APPROVED")
    } else{
        println("DENIED")
    }

}
