#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,sum;
  while(1){
    sum = 0;
    cin >> n;
    if(n == 0) break;
    for(int i=1; i*i<=n; i++){
	if(n%i == 0 ){
	  int j=n/i;
	  //jは片方の約数
          sum += i;
          if(j != i ) sum += j;
        }
    }
    sum = sum - n;
  if(n==sum) cout << "perfect number" << endl;
  if(n>sum) cout << "deficient number" << endl;
  if(n<sum) cout << "abundant number" << endl;
  }
  return 0;
}
