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

int main(){
  int n;
  int i;
   while(scanf("%d",&n)!=EOF){
      double m = sqrt(n);
      int s = 0;
      printf("%lf\n",m);
      for(i=1;i<=m;i++){
        if(n%i==0){
          s += i ;
          if(i!=n/i && i!=1){s += n/i; }
        }
      }
      if(s<n){printf("deficient number\n");}
      else if(s==n){printf("perfect number\n");}
      else{printf("abundant number\n");}
   }
   return 0;
}