#include <iostream>

using namespace std;

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