#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main(){

  for(int n;cin>>n,n;){
    int r=0;
    for(int i=1;i*i<=n;i++) if(!(n%i)){
        int x=n/i;
        if(i!=x) r+=i;
        if(i!=1) r+=x;
      }
    if(n==r) cout<<"perfect number"<<endl;
    else if(n>r) cout<<"deficient number"<<endl;
    else cout<<"abundant number"<<endl;
  }
  return 0;
}