#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int lli;
int main(){
    while(1){
        lli n;
        cin >> n;
        if(n==0) break;

        lli s=0;
        if(n!=1) s=1;
        for(lli i=2; i*i<=n; i++){
            if(n%i == 0){
                s += i;
                s += n/i;
            }
            if(i*i == n) s -= i;
        }
        if(n == s){
            cout << "perfect number" << endl;
        }else if(n > s){
            cout << "deficient number" << endl;
        }else{
            cout << "abundant number" << endl;
        }
    }
    return 0;
}

