import scala.annotation.tailrec
import scala.io.StdIn._
object Main extends App {

  val n = readInt
  val coefficient = Array.tabulate(n + 1){_ ⇒ readLong}
  val primes = primesUnder(1000000)
  val g = coefficient.reduce(gcd)
  primes.filter(p ⇒ g % p == 0 || (p <= n && canDivide(coefficient, p))).foreach(println)
  if (g != 1 && primes.forall(g % _ != 0)) println(g)
  def canDivide(coefficient: Array[Long], prime: Int): Boolean = {//x^p - x
    @tailrec def sub(position: Int, minus: Long = 0): Boolean = {
      if (position >= coefficient.length) minus % prime == 0
      else sub(position + prime - 1, coefficient(position) + minus)
    }
    (0 until prime - 1).forall(i ⇒ sub(i))
  }

  def gcd(a: Long, b: Long): Long = {
    @tailrec def sub(a: Long ,b: Long): Long = {
      if (b == 0L) a else sub(b, a % b)
    }
    sub(math.abs(a), math.abs(b))
  }
  def primesUnder(upperLimit: Int): Array[Int] = {
    val isPrime = Array.fill(upperLimit + 1){true}
    for (p ← 2 to math.sqrt(upperLimit).toInt if isPrime(p)){
      for (j ← p * p to upperLimit by p) isPrime(j) = false
    }
    (2 to upperLimit).filter(isPrime).toArray
  }
}