#include<stdio.h>

int main(){
  int i, n, m, s;

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

    for(i=1, s=0; i<=n/2; i++){
      m = n % i;
      if(m == 0) s += i;
    }

    if(n == s)
      printf("perfect number\n");
    else if(n > s)
      printf("deficient number\n");
    else
      printf("abundant number\n");
  }
  return 0;
}