N = gets.to_i

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

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_gcm(a, b)
	if a < b
		calc_gcm(b, a)
	elsif b == 0
		a
	else
		calc_gcm(a % b, b)
	end
end

gcm = as.length > 0 ? as[0][1].abs : 1
(1...N).each{|i|
	gcm = calc_gcm(gcm, as[i][1].abs)
	if gcm == 1
		break
	end
}
if gcm > 1
	as.each{|pair|
		pair[1] /= gcm
	}
end

#p gcm
#p as
#p a0

def divide(as, n)
	while as.length > 0
		left = as.clone
		first = left.shift
		p, k = first
		p -= 1
		if left.length > 0 && left[0][0] == p
			new_k = left[0][1] - k * n
			if new_k != 0
				left[0] = [p, new_k]
			else
				left.shift
			end
		else
			left.unshift([p, -k * n])
		end
		
		if left.length == 1
			return nil
		end
		
		as = left
	end
	
	return as
end

def check(as, gcm, n)
	(1...n).each{|i|
		if new_as = divide(as, i)
			as = new_as
		elsif new_as = divide(as, -n + i)
			as = new_as
		else
			return false
		end
	}
	return true
end

answers = []
decompose(a0).sort.uniq.each{|n|
	if as.length == 0 || gcm % n == 0
		answers << n
	else
		new_as = []
		as.each{|p, k|
			if k % n != 0
				new_as << [p - 1, k]
			end
		}
		if new_as.length == 0
			answers << n
		elsif check(new_as, gcm, n)
			answers << n
		end
	end
}

answers.each{|n|
	puts n
}
