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

int main(void){
  int i,n,s,to;

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

    if(n == 1){
      s = to = 0;
    }
    else{
      s = 1;
      to = sqrt(n);
    }

    for(i = 2; i <= to; i++){
      if(n % i == 0){
	s += i;
	s += n / i;
      }
    }
    if(to * to == n){
      s -= to;
    }

    if(n > s){
      printf("deficient number\n");
    }
    else if(n == s){
      printf("perfect number\n");
    }
    else{
      printf("abundant number\n");
    }
  }
  return 0;
}