#include <stdio.h>

#define ABUNDANT "abundant number"
#define PERFECT "perfect number"
#define DEFICIENT "deficient number"

typedef unsigned long long ull;

ull x;

int solve(void){
	ull divisor = 2;
	ull ans = 1;
	ull sum = x;
	ull append;
	while(sum != 1){
		append = divisor;
		while(!(sum % divisor)){
			append *= divisor;
			sum /= divisor;
		}
		append--;
		append /= (divisor - 1);
		ans *= append;
		if(sum != 1 && divisor * divisor > sum){
			ans *= (sum + 1);
			sum = 1;
		}
		divisor++;
		abun:
		if(ans > x * 2){
			return puts(ABUNDANT);
		}
	}
	if (ans == x * 2){
		return puts(PERFECT);
	} else {
		return puts(DEFICIENT);
	}
}

ull in(){
	scanf("%llu", &x);
	return x;
}

int main(void){
	while(in()){
		solve();
	}
	return 0;
}