require 'prime'
def ans(x, y)
  case
  when x < y then
    'abundant number'
  when x == y then
    'perfect number'
  when x > y then
    'deficient number'
  end
end
def solve(x)
  return if x == 0
  sum = Prime.prime_division(x).inject(1) {|sum, a| (sum * ((a[0] ** (a[1] + 1)) - 1)) / (a[0] - 1) } - x
  puts ans(x, sum)
end
$stdin.read.split("\n").map(&:to_i).each(&method(:solve))