#include <bits/stdc++.h>
using namespace std;

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