#include<stdio.h>

typedef unsigned long long ull;

int main(void){
  int num,sum;
  int i,j;
  while(scanf("%d",&num)&&num){
    sum=0;
    for(i=2;i*i<=num;i++){
      if(num%i==0){
	sum+=i+num/i;
	if(i==num/i) sum-=i;
      }
    }
    if(num!=1) sum++;
    if(sum<num) puts("deficient number");
    else if(sum==num) puts("perfect number");
    else puts("abundant number");
  }
  return 0;
}

    