import std.stdio, std.string, std.conv;

void main()
{
    while(true)
    {
        int n=readln.chomp.to!int;
        if(n==0) break;
        if(n==1)
        {
           "deficient number".writeln;
           continue;
        }

        int s=1;
        for(int i=2; i*i <= n; ++i)
        {
            if(n/i*i==n)
            {
                if(i*i==n) s+=i;
                else s+=i+n/i;
            }
        }

        if(s<n) "deficient number".writeln;
        else if(s>n) "abundant number".writeln;
        else "perfect number".writeln;
    }
}