require 'prime'
N=gets.to_i
A=(N+1).times.map{gets.to_i}
G=(A.inject(A[0],:gcd).prime_division.map{|k,_|k}+Prime.each(N).map{|k|k}).sort
def div(q)
    if A[-1]%q!=0
        return A[-1]%q
    end
    l=A.map{|a|a%q}
    r=A[0,q].map{|a|a%q}
    #p l,r
    (0..(N-q)).each{|i|
        a = r.shift
        r[-1] = (r[-1]+a)%q
        r << l[q+i]
        #p r
    }
    r.inject :+
end
G.each{|q|
    #p q
    if div(q)==0 then p q end
}