#include <iostream>
#include <algorithm>
#include <cmath>
#define int long long
using namespace std;
signed main() {
	int n;
	while (cin >> n, n) {
		if (n == 1) {
			cout << "deficient number\n";
			continue;
		}
		int sum = 1;
		for (int i = 2; i <= sqrt(n); i++) {
			if (n % i == 0)sum += i + (n / i);
			if (i*i == n)sum -= i;
		}
		if (n == sum)cout << "perfect number\n";
		else cout << (n < sum ? "abundant number\n" : "deficient number\n");
	}
}
