#include<bits/stdc++.h>
using namespace std;

int main(){
  int n;
  while(cin>>n,n){
    int a=2;
    int tmp=n;
    vector<int> ans;
    ans.push_back(1);
    while((int)sqrt(n)>=a && n!=1){
      if(n%a==0){
	ans.push_back(a);
	if(a!=n/a)
	  ans.push_back(n/a);
      }
      a++;
    }
    int b=0;
    for(int i=0;i<ans.size();i++){
      if(ans[i]==tmp)continue;
      b+=ans[i];
    }
    if(tmp==b && tmp != 1){
      cout << "perfect number" << endl;
    }else if(tmp > b){
      cout << "deficient number" << endl;
    }else{
      cout << "abundant number" << endl;
    }
  }
  return 0;
}