#include <iostream>
#include <cstdlib>

using namespace std;

int main() {
  
  int n;
  while( 1 ) {
    cin >> n;
    if( !n ) { break; }

    if( n == 1 ) {
      cout << "deficient number" << endl;
      continue;
    }
    int sum = 1;
    for( int i = 2; i * i < n; i++ ) {
      if( n % i == 0 ) { 
        sum += i;
        if( i * i != n ) {
          sum += n / i;
        }

        if( sum > n ) { break; }
      }
    }

    cout << (
      ( sum  < n ) ? "deficient number" :
      ( sum == n ) ? "perfect number"   :
                     "abundant number"
    ) << endl;
  }

  return EXIT_SUCCESS;
}