N = gets.to_i

as = []
N.times{|i|
	as << [N - 1, gets.to_i]
}
a0 = gets.to_i

#p as
#p a0

def decompose(n)
	(2..Math.sqrt(n).ceil).each{|i|
		if n % i == 0
			return [i] + decompose(n / i)
		end
	}
	return [n]
end

#def calc(as, x)
#	tmp_x = x
#	value = 0
#	as.reverse_each{|a|
#		value += a * tmp_x
#		tmp_x *= x
#	}
#	value
#end

def calc(as, x)
	value = 0
	as.each{|pow, a|
		value += a * (x ** pow)
	}
	value
end

def check(as, n)
	if as.length == 0
		return true
	end
	n.times.reverse_each{|x|
		value = calc(as, x)
		if value % n != 0
			return false
		end
	}
	return true
end

answers = []
decompose(a0).sort.uniq.each{|n|
	new_as = []
	as.each{|pair|
		if pair[1] % n != 0
			new_as << pair
		end
	}
	answers << n if check(new_as, n)
}

answers.each{|n|
	puts n
}
