#include <iostream>
#include <set>
using namespace std;

int main(){
    while(1){
        int n; cin>>n;
        if(n == 0) return 0;

        long long sum = 0;
        set<long long> div;
        for(int i=1; i*i<=n; i++){
            if(n % i == 0){
                if(i != n) div.emplace(i);
                if(n / i != n) div.emplace(n / i);
            }
        }

        for(auto i:div){
            sum += i;
        }

        if(n == sum){
            cout << "perfect number" << endl;
        }
        else if(n > sum){
            cout << "deficient number" << endl;
        }
        else{
            cout << "abundant number" << endl;
        }
    }
}
