import java.util.*

fun main(args:Array<String>):Unit {
    val prime = primes(10000)
    var n = readLine()!!.toLong()
    while (n != 0L){
        var sumOfFactor:Long = 1L
        var restFactor = n
        prime.forEach {
            restFactor = divideWhile(restFactor, it)
            sumOfFactor *= sumOfExp(it, log(n, it))
        }
        if (restFactor != 1L) sumOfFactor *= restFactor + 1
        sumOfFactor -= n
        println(when{
            sumOfFactor < n -> "deficient number"
            sumOfFactor > n -> "abundant number"
            else -> "perfect number"
        })
        n = readLine()!!.toLong()
    }
}
fun log(n:Long, prime:Int):Int {
    return when{
        n % prime == 0L -> 1 + log(n / prime, prime)
        else -> 0
    }
}
fun divideWhile(n:Long, prime:Int):Long {
    return when{
        n % prime == 0L -> divideWhile(n / prime, prime)
        else -> n
    }
}
fun sumOfExp(prime:Int, exp:Int):Long {
    return when(exp){
        0 -> 1L
        else -> 1L + sumOfExp(prime, exp - 1) * prime
    }
}
fun primes(upper:Int):Array<Int> {
    val res = Stack<Int>()
    val memo = Array(upper + 1){true}
    res.push(2)
    for (i in 2 .. upper step  2)
        memo[i] = false
    for (i in 3 .. upper step 2)
        if (memo[i]){
            res.push(i)
            for (j in i * 2 .. upper step i)
                memo[j] = false
        }
    return res.toTypedArray()
}

