#include<stdio.h>
int main(void){
	int n;
	while(1){
		int i,s=0,squareroot;
		scanf("%d",&n);
		if(n==0)break;
		
		for(i=1;;i++){
			if(i*i<=n&&n<(i+1)*(i+1)){
				squareroot=i;
				break;
			}
			
		}
		for(i=1;i<=squareroot;i++){
			if(n%i==0){
				s+=n/i;
				s+=i;
				if(i==n/i)s-=i;
			}
			
			
			
			
		}
		s-=n;
		
		if(n==s)printf("perfect number\n");
		else if(n>s)printf("deficient number\n");
		else printf("abundant number\n");
		
	}
	return 0;
}