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