import sys

from fractions import gcd





def eratosthenes_generator():

    yield 2

    n = 3

    h = {}

    while True:

        m = n

        if n in h:

            b = h[n]

            del h[n]

        else:

            b = n

            yield n

        m += b << 1

        while m in h:

            m += b << 1

        h[m] = b

        n += 2





def prime(n):

    ret = []

    for i in eratosthenes_generator():

        if n % i == 0:

            ret.append(i)

            while n % i == 0:

                n = n // i

        if n == 1 or i * i > n:

            break

    if n > 1:

        ret.append(n)

    return ret





def solve(n, aaa):

    g = abs(aaa[-1])

    for a in aaa[:-1]:

        if a != 0:

            g = gcd(g, abs(a))

    ans = set(prime(g))



    for p in eratosthenes_generator():

        if p > n + 2:

            break

        if p in ans or aaa[0] % p != 0:

            continue

        q = p - 1

        tmp = [0] * q

        for i, a in enumerate(aaa):

            tmp[i % q] += a

        if all(t % p == 0 for t in tmp):

            ans.add(p)



    ans = sorted(ans)

    return ans





n = int(eval(input()))

aaa = list(map(int, sys.stdin))

aaa.reverse()

print(('\n'.join(map(str, solve(n, aaa)))))

import sys

from fractions import gcd





def eratosthenes_generator():

    yield 2

    n = 3

    h = {}

    while True:

        m = n

        if n in h:

            b = h[n]

            del h[n]

        else:

            b = n

            yield n

        m += b << 1

        while m in h:

            m += b << 1

        h[m] = b

        n += 2





def prime(n):

    ret = []

    for i in eratosthenes_generator():

        if n % i == 0:

            ret.append(i)

            while n % i == 0:

                n = n // i

        if n == 1 or i * i > n:

            break

    if n > 1:

        ret.append(n)

    return ret





def solve(n, aaa):

    g = abs(aaa[-1])

    for a in aaa[:-1]:

        if a != 0:

            g = gcd(g, abs(a))

    ans = set(prime(g))



    for p in eratosthenes_generator():

        if p > n + 2:

            break

        if p in ans or aaa[0] % p != 0:

            continue

        q = p - 1

        if all(sum(aaa[i::q]) % p == 0 for i in range(q)):

            ans.add(p)



    ans = sorted(ans)

    return ans





n = int(eval(input()))

aaa = list(map(int, sys.stdin))

aaa.reverse()

print(('\n'.join(map(str, solve(n, aaa)))))

import sys
from fractions import gcd


def eratosthenes_generator():
    yield 2
    n = 3
    h = {}
    while True:
        m = n
        if n in h:
            b = h[n]
            del h[n]
        else:
            b = n
            yield n
        m += b << 1
        while m in h:
            m += b << 1
        h[m] = b
        n += 2


def prime(n):
    ret = []
    for i in eratosthenes_generator():
        if n % i == 0:
            ret.append(i)
            while n % i == 0:
                n = n // i
        if n == 1 or i * i > n:
            break
    if n > 1:
        ret.append(n)
    return ret


def solve(n, aaa):
    g = abs(aaa[-1])
    for a in aaa[:-1]:
        if a != 0:
            g = gcd(g, abs(a))
    ans = set(prime(g))
    for p in eratosthenes_generator():
        if p > n + 2:
            break
        if p in ans or aaa[0] % p != 0:
            continue
        q = p - 1
        tmp = [0] * q
        for i, a in enumerate(aaa):
            tmp[i % q] += a
        if all(t % p == 0 for t in tmp):
            ans.add(p)
    ans = sorted(ans)
    return ans


n = int(eval(input()))
aaa = list(map(int, sys.stdin))
aaa.reverse()
print(("\n".join(map(str, solve(n, aaa)))))

import sys
from fractions import gcd


def eratosthenes_generator():
    yield 2
    n = 3
    h = {}
    while True:
        m = n
        if n in h:
            b = h[n]
            del h[n]
        else:
            b = n
            yield n
        m += b << 1
        while m in h:
            m += b << 1
        h[m] = b
        n += 2


def prime(n):
    ret = []
    for i in eratosthenes_generator():
        if n % i == 0:
            ret.append(i)
            while n % i == 0:
                n = n // i
        if n == 1 or i * i > n:
            break
    if n > 1:
        ret.append(n)
    return ret


def solve(n, aaa):
    g = abs(aaa[-1])
    for a in aaa[:-1]:
        if a != 0:
            g = gcd(g, abs(a))
    ans = set(prime(g))
    for p in eratosthenes_generator():
        if p > n + 2:
            break
        if p in ans or aaa[0] % p != 0:
            continue
        q = p - 1
        if all(sum(aaa[i::q]) % p == 0 for i in range(q)):
            ans.add(p)
    ans = sorted(ans)
    return ans


n = int(eval(input()))
aaa = list(map(int, sys.stdin))
aaa.reverse()
print(("\n".join(map(str, solve(n, aaa)))))

-        tmp = [0] * q -        for i, a in enumerate(aaa): -            tmp[i % q] += a -        if all(t % p == 0 for t in tmp): +        if all(sum(aaa[i::q]) % p == 0 for i in range(q)):