#include<iostream>

using namespace std;

void solve(int in){
  int ans = 0;
  if(in > 1) ans = 1;
  for(int i = 2; i * i <= in; i++){
    if(in%i == 0){
      if(i != in/i) ans += in/i;
      ans += i;
    }
  }
 
  if(ans > in) cout << "abundant number" << endl;
  if(ans == in) cout << "perfect number" << endl;
  if(ans < in) cout << "deficient number" << endl;
}

int main(){
  int in;
  while(cin >> in && in) solve(in);
  return 0;
}