#include <stdio.h>

int main(void) {
	int n;
	while(scanf("%d", &n) != EOF){
		if(n == 0) break;
		int i,sum = 0;
		for(i = 2; n >= i; i++){
			if(n%i == 0)
				sum += n/i;
		}
		printf("%s\n", sum == n ? "perfect number" : sum < n ? "deficient number" : "abundant number");
	}
	return 0;
}