#include<iostream>

int main(){
	int n;
	while(std::cin>>n,n){
		int sum=0;
		for(int i=1;i*i<=n;i++){
			if(n%i==0){
				int j=n/i;
				if(i!=n)sum+=i;
				if(i!=j&&j!=n)sum+=j;
			}
		}
		if(sum==n)std::cout<<"perfect number"<<std::endl;
		else if(sum<n)std::cout<<"deficient number"<<std::endl;
		else if(sum>n)std::cout<<"abundant number"<<std::endl;
	}
	return 0;
}