#include<iostream>
using namespace std;

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