#include<stdio.h>

int main(void){

int n;

while(scanf("%d",&n) != EOF){

if(n == 0){
break;
}

int s = 0;
for(int i = 1; i<n; i++){
  if(n%i == 0){
   s += i;
  }
}
  
if(n == s){
printf("perfect number\n");
}

else if(n > s){
printf("deficient number\n");
}

else if(n < s){
printf("abundant number\n");
}
}
return 0;
}
