You are given a polynomial of degree N with integer coefficients: f(x)=a_Nx^N+a_{N-1}x^{N-1}+...+a_0. Find all prime numbers p that divide f(x) for every integer x.

Constraints

* 0 \leq N \leq 10^4
* |a_i| \leq 10^9(0\leq i\leq N)
* a_N \neq 0
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


N
a_N
:
a_0


Output

Print all prime numbers p that divide f(x) for every integer x, in ascending order.

Examples

Input

2
7
-7
14


Output

2
7


Input

3
1
4
1
5


Output




Input

0
998244353


Output

998244353
#include <bits/stdc++.h>

using namespace std;

using ll = long long;

struct Prime {
    int N;
    vector<bool> is_p;

    Prime(int _N) : N(_N), is_p(N + 1, true) {
        is_p[0] = is_p[1] = false;
        for (long long i = 2; i <= N; ++i) {
            if (is_p[i])
                for (long long j = i * i; j <= N; j += i)
                    is_p[j] = false;
        }
    }
    bool operator[](const int idx) const { return is_p[idx]; }
};

template<class T>
std::vector<std::pair<T, T>> PrimeFactorization(T n) {
    std::vector<std::pair<T, T>> pf;
    T m = n;
    for (T i = 2; i * i <= n; ++i) {
        if (m % i != 0) continue;
        T cnt = 0;
        while (m % i == 0) { ++cnt; m /= i; }
        pf.emplace_back(std::make_pair(i, cnt));
    }
    if (1 < m) pf.emplace_back(std::make_pair(m, 1));

    return pf;
}

inline ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

bool Check(const ll p, const ll n, const vector<ll> &a) {
    if (a[0] % p != 0) return false;
    for (ll s = 0; s <= min(n, p - 2); ++s) {
        ll sum = 0;
        for (ll x = s; x <= n; x += p - 1) sum += a[x];
        if (sum % p != 0) return false;
    }
    return true;
}

int main() {
    cin.tie(0); ios::sync_with_stdio(false);

    ll n;
    cin >> n;

    vector<ll> a(n + 1);
    for (int i = n; 0 <= i; --i) cin >> a[i];

    Prime primes(n);
    set<ll> ans_p;
    for (ll p = 2; p <= n; ++p) {
        if (primes[p] && Check(p, n, a)) ans_p.insert(p);
    }

    ll g = abs(a[0]);
    for (int i = 1; i <= n; ++i) g = gcd(g, abs(a[i]));
    auto pf = PrimeFactorization<ll>(g);
    for (auto it : pf) ans_p.insert(it.first);

    // auto pf = PrimeFactorization<ll>(abs(a[n]));
    // for (auto p : pf) {
    //     if (Check(p.first, n, a)) ans_p.insert(p.first);
    // }

    for (auto p : ans_p) cout << p << '\n';

    return 0;
}
