// AOJ 2101 (http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2101)
#include<cstdio>

int divS( int n )
{
	int ret = 0;

	for( int i = 1; i*i <= n; ++i ) if( n % i == 0 )
	{
		ret += i;

		if( i != n/i )
			ret += n/i;
	}

	return ret-n;
}

int main()
{
	int N;
	while( scanf( "%d", &N ), N )
	{
		int S = divS(N);

		puts( N==S?"perfect number":N>S?"deficient number":"abundant number" );
	}

	return 0;
}