#include <stdio.h>

int main(void)
{
	int n;
	int i,j,num;
	
	while(scanf("%d",&n)&&n!=0){
		num=0;
		for(i=1;i*i<=n;i++){
			if(n%i==0) num+=i;
		}
		if(num==n){
			printf("perfect number\n");
		}
		else if(num>n){
			printf("abundant number\n");
		}
		else {
			printf("deficient number\n");
		}
	}
	return 0 ;
}