#include<bits/stdc++.h>
using namespace std;

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

    