#include <stdio.h>

int main() {
  int n,a,sum,i;


  while(1) {
    sum =0;
    scanf("%d",&n);
    if(n == 0) break;

  for(i=1;i<n;i++) {

    if(n %i == 0) {
      sum += i;
      
    }
  }

  if(sum == n) printf("perfect number\n");
  else if(n > sum) printf("deficient number\n");
  else printf("abundant number\n");

  }

  return 0;

}