#include<stdio.h>

int main(){
  int i,j,n,ie,sum;
  
  do{
    scanf("%d",&n);
    if(!n) break;
    if(n==1){
      printf("deficient number\n");
      continue;
    }
    for(sum=1,i=2,j=n;i<j;i++){
      if(n%i==0){
	j=n/i;
	if(i!=j)
	  sum+=i+j;
	else
	  sum+=i;
      }
    }
    printf("%s\n",sum==n?"perfect number":
	   sum<n?"deficient number":"abundant number");
  }while(1);
  return 0;
}