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

int main() {
    int N;
    while (cin >> N, N) {
        int S = 0;
        if (N != 1) S = 1;
        for (int i=2; i*i<=N; ++i) {
            if (i * i == N) {
                S += i;
            } else if (N % i == 0) {
                S += i;
                S += N / i;
            }
        }
        if (N == S) {
            cout << "perfect number" << endl;
        } else if (N > S) {
            cout << "deficient number" << endl;
        } else if (N < S) {
            cout << "abundant number" << endl;
        }
    }
    return 0;
}