require 'prime'
N=gets.to_i
A=(N+1).times.map{gets.to_i}
f = lambda{|x| (0..N).step(2).inject(0){|memo,i| memo+A[i]*x**(N-i)}}
g = lambda{|x| (1..N).step(2).inject(0){|memo,i| memo+A[i]*x**(N-i)}}
ps= (1..(N/2)).inject(f[0]+g[0]){|memo,i|gi=g[i];memo.gcd((f[i]+gi).gcd(gi*2))}
ps.prime_division.each{|k,i|p k}