#include <stdio.h>
#include <math.h>

int main(void)
{
  int n;
  int sum;
  int i;
  while(1){
    scanf("%d",&n);
    if(n==0)
      break;
    sum=1;
    for(i=2;i<=sqrt((double)n);i++){
      if(n%i==0){
	if(i!=n/i)
	  sum+=(i+(n/i));
	else
	  sum+=i;
      }
    }
    
    if(n>sum||n==1)
      printf("deficient number\n");
    else if(n==sum)
      printf("perfect number\n");
    else
      printf("abundant number\n");
  }

  return 0;
}