#include <iostream>

using namespace std;

int main(void){

  long long n;

  while( cin >> n , n ){

    if( n == 1 ){
      cout << "deficient number" << endl;
      continue;
    }

    long long total = 1;
    long long a = 0;

    for( int i = 2 ; a != i && i < n/2 ; i++ ){
      if( n % i == 0 ){
	total += i;
	total += ( n / i );
	a = n / i;
	if( a == i ){
	  total -= i;
	  break;
	}
      }
      if( total > n ) break;
    }
    //cout << "a = " << a << endl;
    //cout << total << "    ";
    if( n == total ) cout << "perfect number" << endl;
    if( n < total ) cout << "abundant number" << endl;
    if( n > total ) cout << "deficient number" << endl;

  }
  return 0;
}