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 <iostream>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;

vector<pair<long long, long long> > prime_factorize(long long n) {
    vector<pair<long long, long long> > res;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}

long long GCD(long long a, long long b) {
    if (a < 0) a = -a;
    if (b < 0) b = -b;
    if (b == 0) return a;
    else return GCD(b, a % b);
}


vector<bool> isprime;
vector<int> Era(int n) {
    isprime.resize(n, true);
    vector<int> res;
    isprime[0] = false; isprime[1] = false;
    for (int i = 2; i < n; ++i) isprime[i] = true;
    for (int i = 2; i < n; ++i) {
        if (isprime[i]) {
            res.push_back(i);
            for (int j = i*2; j < n; j += i) isprime[j] = false;
        }
    }
    return res;
}

int main() {
    long long N; cin >> N;
    vector<long long> a(N+1);
    for (int i = 0; i < N+1; ++i) cin >> a[i];
    reverse(a.begin(), a.end());

    set<long long> res;
     
    // f(x) ≡ 0 の場合
    long long g = 0;
    for (int i = 0; i < N+1; ++i) g = GCD(g, a[i]);
    auto pf = prime_factorize(g);
    for (auto p : pf) res.insert(p.first);

    // N 以下の素数 p をすべて試す
    auto prs = Era(10101);
    for (auto p : prs) {
        vector<long long> c(p, 0);
        for (int d = 0; d < p; ++d) c[d] = a[d] % p;
        for (int d = p; d <= N; ++d) {
            int r = d % (p-1);
            if (r == 0) r = p-1;
            c[r] = (c[r] + a[d] % p) % p;
        }

        bool ok = true;
        for (int d = 0; d < p; ++d) if (c[d] != 0) ok = false;
        if (ok) res.insert(p);
    }
    for (auto p : res) cout << p << endl;
}












