#include <stdio.h>

int main(void) {
	int N, S;
	int i;
	int lim;

	while(1) {
		scanf("%d", &N);
		if(!N)
			break;
		if(N == 1) {
			printf("deficient number\n");
			continue;
		}
		
		lim = N / 2; S = 1;
		for(i = 2; i < lim; i++) {
			if(!(N % i)) {
				S += i;
				if(i != N / i)
					S += N / i;
			}
			lim = N / i;
		}

		if(S == N)
			printf("perfect number\n");
		else if(S < N)
			printf("deficient number\n");
		else
			printf("abundant number\n");
	}

	return 0;
}