#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <functional>
#include <iterator>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
using namespace std;
typedef istringstream ISS;
typedef ostringstream OSS;
typedef vector<string> VS;
typedef int INT;
typedef vector<INT> VI;
typedef vector<VI> VVI;
typedef pair<INT, INT> II;
typedef long long LL;
const string OUT[3] = {
	"perfect number",
	"deficient number",
	"abundant number"
};
LL N;
bool input() {
	return cin >> N && N;
}
int solve() {
	LL sum = 0;
	for ( LL i = 1; i * i < N; ++ i ) {
		if ( N % i == 0 ) {
			if ( i != N / i && i != 1 ) {
				sum += i + N / i;
			} else {
				sum += i;
			}
		}
	}
	if ( N == sum ) return 0;
	return N < sum ? 2 : 1;
}
void output( int result ) {
	cout << OUT[result] << endl;
}
int main() {
    while ( input() ) {
        output( solve() );
    }
}