#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;

    while (cin >> n, n) {
        int s = 0;

        for (int i = 1; i * i <= n; ++i) {
            if (n % i == 0) {
                s += i;
                if (n / i != n && i * i != n) s += n / i;
            }
        }

        cout << ((s < n || n == 1) ? "deficient number" : s > n ? "abundant number" : "perfect number") << endl;
    }
}