#include <stdio.h>


int main() {
  int n,sum,x,i,j;

  while(1) {
    sum = 0;
    scanf("%d",&n);

    if(n == 0) break;

    for(i = 1; i*i<n;i++) {
      if(n%i == 0) {
	sum = sum + i;
	if(i*i != n) sum =sum + n / i;
      }

    } 

    sum -= n;
    
    
    if(sum == n) printf("perfect number\n");
    else if(n > sum) printf("deficient number\n");
    else printf("abundant number\n");

  }

  return 0;

}