import std.stdio, std.string, std.conv, std.algorithm;
void main()
{
  while(1){
    auto n = readln.chomp.to!int;
    if(n==0) break;
    int s=1;
    int max=50000001;
    for(int i=2;i<n/2;++i){
      if(n%i==0){
	if(i<max){
	  s+=(i+n/i);
	  max = n/i;
	  if(i==max)
	    s -= i;
	}else break;
      }else if(i>max) break;
    }
    if(s<n || n==1) writeln("deficient number");
    else if(s==n) writeln("perfect number");
    else writeln("abundant number");
  }
}