require 'prime'
loop {
	n = n0 = gets.to_i
	break if n == 0
	a = []	
	Prime.each(Math.sqrt(n).to_i){|q|
		k = 0
		while n % q == 0
			n /= q
			k += 1
		end
		a << [q, k] if k > 0
	}
	a << [n, 1] if n > 1
	s = a.map{|q, k| (q**(k+1) - 1) / (q - 1)}.inject(1, :*) 
	puts s < 2 * n0 ? 'deficient number' :
		 s > 2 * n0 ? 'abundant number' :
		              'perfect number'
}