#include <stdio.h>

int main(void)
{
	int n, s;
	int i;

	while (1) {
		scanf("%d", &n);
		if (n == 0)
			break;
		s = 0;
		for (i = 1; i < n; i++)
			if (n % i == 0)
				s += i;
		if (n == s)
			puts("perfect number");
		else if (n > s)
			puts("deficient number");
		else
			puts("abundant number");
	}

	return 0;
}