#include<iostream>
#include<cmath>
#include<vector>
using namespace std;

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

    vector<int> d;
    int r = (int)sqrt(n);
    for(int i=2;i<=r;i++){
      if( !(n%i) ){
	d.push_back(i);
	if(i!=n/i)d.push_back(n/i);
      }
    }

    int sum = 0;
    if(n!=1){
      sum += 1;
      for(int i=0;i<(int)d.size();i++){
	sum += d[i];
      }
    }
    if(sum<n)cout << "deficient number" << endl;
    else if(sum>n)cout << "abundant number" << endl;
    else cout << "perfect number" << endl;
  }
}