#include<stdio.h>

int perfect(long n){
	long sum=0;
	for(int i=1;i<n;i++){
		if(n%i==0) sum+=i;
		}
	return sum;
}

int main(void){
	long n;
	while(scanf("%ld",&n) != EOF ){
	if(n==0) break;
	if(n==perfect(n)) printf("perfect number\n");
	else if(n>perfect(n)) printf("deficient number\n");
	else printf("abundant number\n");
	}
	return 0;
}



