#include <stdio.h>

int main(){

  long int N, S, i;

  while(1){

    scanf("%ld", &N);

    if(N == 0)
      break;

    else{

      S = 0;

      for(i = 1;i < N;i++){

	if(N % i == 0)

	  S += i;

      }

      if(N == S)

	printf("perfect number\n");

      else if(N > S || S == 0)

	printf("deficient number\n");

      else if(N < S)

	printf("abundant number\n");

    }

  }

 
  return 0;
}