import scala.io.StdIn.readInt
import scala.collection.mutable.ArrayBuffer

object Main {
  def main(args:Array[String]) = {
    val b = new ArrayBuffer[String]
    var n = 0
    while({n=readInt;n} != 0) {
      val s = (1 to Math.sqrt(n).toInt).filter(n%_==0).map{i=>
        if(i!=n/i) i+n/i
        else i
      }
      if(n==s.sum-n) b+="perfect number"
      else if(n>s.sum-n) b+="deficient number"
      else b+="abundant number"
    }
    println(b.mkString("\n"))
  }

}