#include <stdio.h>

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  int i;

  for ( ; ; )
  {
    int n;
    int s = 0;

    scanf ( "%d", &n );
    if ( !n ) break ;

    for ( i = 1; i * i <= n; ++i )
    {
      if ( i * i == n && !( n % i ) )
      {
        s += i;
      }
      else if ( !( n % i ) )
      {
        s += i + ( n / i );
      }
    }
    s -= n;

    if ( n > s )
    {
      puts ( "deficient number" );
    }
    else if ( n < s )
    {
      puts ( "abundant number" );
    }
    else
    {
      puts ( "perfect number" );
    }
  }

  return ( 0 );
}