#include <stdio.h>
int main(){

  int n,sum,i;

  while(1){

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

    if(n%2 == 1){

      printf("deficient number\n");
      continue;

    }

    sum=1;

    for(i = 2; i*i < n; i++){

      if(n%i == 0) sum += i+n/i;

    }

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

  }

  return 0;

}