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

int main(void) { 
  int num; 
  
  while(1){
      scanf("%d",&num);
      if(num == 0) {
          break;
      }
      
      int i;
      int divPlus = 1;
      
      int med = floor(sqrt(num));
      
      if(num == 1) {
          printf("deficient number\n");
      } else {
          for(i = 2; i <= med; i++){
              if(num%i == 0) {
                  divPlus+= i;
                  int quot = num / i;
                  if(i != quot) {
                      divPlus+= (num/i);
                  }
            }
          }
          if(divPlus == num) {
          printf("perfect number\n");
      }else if(divPlus < num) {
          printf("deficient number\n");
      } else {
          printf("abundant number\n");
        }
      }
      
  }
  
  return 0;
  
} 