#include <stdio.h>

int main(void){
  int i;
  int n, S;

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

    if(n == 1){
      printf("deficient number\n");
      continue;
    }

    S = 1;

    for(i = 2; i * i <= n; i++){
      if(n % i != 0) continue;
      S += i;

      if(i != n / i){
        S += n / i;
      }
    }

    if(S == n){
      printf("perfect number\n");
    }
    else if(S < n){
      printf("deficient number\n");
    }
    else{
      printf("abundant number\n");
    }
  }

  return 0;
}