#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<climits>
#include<cmath>
using namespace std;
#define MAX 100000010

int n;
void init(){
  n=0;
}

bool input(){
  cin>>n;
  return n;
}

string solve(){
  int ans=1;
  for(int i=2;i*i<n;i++){
    if(n%i==0){
      ans+=i+n/i;
    }
  }

  if(n==1)ans=0;
  if(ans==n){
    return "perfect number";
  }else if(ans<n){
    return "deficient number";
  }else if(ans>n){
    return "abundant number";
  }
}


int main(){
  while(init(),input()){
    cout<<solve()<<endl;
  }
}