#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#include <time.h>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;
typedef complex<double> xy_t;
typedef vector<ll> vll;
typedef vector< vector<ll> > matrix;
#define REP(i, x, y) for(ll i = (ll)x; i < (ll)y; i++)
#define DREP(i, x, y, d) for(ll i = (ll)x; i < (ll)y; i += (ll)d)
#define PER(i, x, y) for(ll i = (ll)x; i > (ll)y; i--)
#define DPER(i, x, y, d) for(ll i = (ll)x; i > (ll)y; i -= (ll)d)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-12;

//「オイラーのふるい」。pnには素数の数が、primesには順番に素数が、
//eulnumsにはその整数を割り切る最小の素数が入る。
//ある数からeulnumsを割っていくとその数の素因数分解が可能。
int pn = 0;
int primes[16000000];
int eulnums[16000000];

void eulerprime(int n) {
    fill(eulnums, eulnums + n + 1, 0);
    for (int i = 2; i <= n; i++) {
        if (eulnums[i] == 0) {
            eulnums[i] = i;
            primes[pn] = i;
            pn++;
        }

        for (int j = 0; i * primes[j] <= n; j++) {
            eulnums[i * primes[j]] = primes[j];
            if (i % primes[j] == 0) {
                break;
            }
        }
    }
}

ll modadd(ll x, ll y, ll p) {
    return ((x + y) % p + p) % p;
}

ll multiply(ll x, ll y, ll p) {
    return (x % p) * (y % p) % p;
}

ll isPrime(int n) {
    ll ans = -1;
    for (int i = 2; i * i <= n; i++) {
        if(n % i == 0) {
            ans = i;
            return ans;
        }
    }
    return ans;
}

ll gcd(ll a, ll b) {
    return b != 0 ? gcd(b, a % b) : a;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    ll a[N + 1];
    REP(i, 0, N + 1) {
        cin >> a[i];
    }
    vector<ll> ans;
    ll g = abs(a[0]);
    REP(i, 1, N + 1) {
        g = gcd(g, abs(a[i]));
    }
    while(1) {
        ll num = isPrime(g);
        if (num == -1) {
            if (g > 1) {
                ans.push_back(g);
            }
            break;
        } else {
            ans.push_back(num);
            g /= num;
        }
    }
    vector<ll> ps;
    eulerprime(N);
    REP(i, 0, pn) {
        ps.push_back(primes[i]);
    }
    ll len = ps.size();
    reverse(a, a + N + 1);
    REP(i, 0, len) {
        ll p = ps[i];
        ll nums[p];
        fill(nums, nums + p, 0);
        nums[0] = a[0] % p;
        REP(i, 1, N + 1) {
            ll mark = (i - 1) % (p - 1) + 1;
            nums[mark] = modadd(nums[mark], a[i], p);
        }
        bool ok = true;
        REP(i, 0, p) {
            if (nums[i] != 0) {
                ok = false;
                break;
            }
        }
        if (ok) {
            ans.push_back(p);
        }
    }
    sort(ans.begin(), ans.end());
    ans.erase(unique(ans.begin(), ans.end()), ans.end());
    ll lenb = ans.size();
    REP(i, 0, lenb) {
        cout << ans[i] << endl;
    }
}


Measured memory_bytes: 2560