#include<stdio.h>
int main(void){
  int x[100] , i,j,sum = 0;
  for(i=0; i<100;i++){
    scanf("%d",&x[i]);
    if(x[i]==0){
      break;
    }
  }
  for(i = 0; i < 100 ;i++){
    if(x[i] == 0) break;
    for(j = 1;j < x[i] - 1; j++){
      if(!(x[i] / 2 < j)){
      if(x[i] % j ==0){
	sum += j;
      }
      }else break;
    }
      if(sum > x[i]){
	printf("abundant number\n");
      }else if(sum == x[i]){
	printf("perfect number\n");
      }else{
	printf("deficient number\n");
      }
      sum = 0;
  }
  return 0;
}
  

