#include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

int n;

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