#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int n;
    while(scanf("%d",&n),n){
        int cnt = 0;
        int x = 0;
        for(int i = 2;i*i < n; i++){
            if(n % i == 0){
                cnt += i;
                x = n/i;
                cnt += x;
            }
        }
        cnt++;
        if(n == 1)printf("deficient number\n");
        else if(n == cnt)printf("perfect number\n");
        else if(n > cnt)printf("deficient number\n");
        else printf("abundant number\n");
    }
    return 0;
}