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;

// 多項式vを (x^p - x) で割りきれるかどうか (F_p 上)
bool divPoly(vector<int> v, int p){
    if(v.size() > p){ // 次数がp以上なら
        vector<int> res(v.size()-p); // 商
        for (int i = v.size() - p - 1; i >= 0; --i) {
            res[i] = v[i+p];
            v[i+p] -= res[i]; // = 0
            v[i+1] += res[i];
            v[i+1] %= p;
        }
    }
    for (int x: v) {
        if(x % p != 0) return false;
    }
    return true;
}

// エラトステネスの篩 (x以下の全素数が昇順に入ったvectorを返す関数), O(n loglog n)
vector<int> AllPrime(int x){
    vector<int>res;
    res.reserve(x);
    vector<int>is_prime(x+1, 1);
    is_prime[0] = is_prime[1] = 0;
    for (int i = 2; i <= x; ++i) {
        if(is_prime[i] == 1){
            res.push_back(i);
            for (int j = i*2; j <= x; j += i) is_prime[j] = 0;
        }
    }
    return res;
}

// 素因数分解, 2^3 なら (2, 3)
vector<pair<ll, int>> factoring(ll n){
    vector<pair<ll, int>> res;
    for (ll i = 2; i * i <= n; ++i) {
        int k = 0;
        while (n % i == 0){
            n /= i;
            k++;
        }
        if(k != 0) res.push_back({i, k});
    }
    if(n != 1) res.push_back({n, 1});
    return res;
}

// 互除法で2正数x,yのgcdを返す関数
ll gcd (ll x, ll y) {
    ll p = x % y;
    while(p){
        x = y;
        y = p;
        p = x % y;
    }
    return y;
}

int main() {
    int N;
    cin >> N;
    vector<int>a(N+1);
    for (int i = N; i >= 0; --i) {
        cin >> a[i];
    }

    int a_gcd = abs(a[N]);
    for (int i = 0; i < N; ++i) {
        if(a[i] == 0) continue;
        a_gcd = gcd(a_gcd, abs(a[i]));
    }
    auto fa = factoring(a_gcd);
    auto pr = AllPrime(N);

    vector<int>ans;
    for (auto x: fa) {
        ans.push_back(x.first);
    }
    for (auto x: pr) {
        if(divPoly(a, x)) ans.push_back(x);
    }

    sort(ans.begin(), ans.end());
    if(ans.size() == 0) return 0;
    cout << ans[0] << "\n";
    for (int i = 1; i < ans.size(); ++i) {
        if(ans[i] != ans[i-1]) cout << ans[i] << "\n";
    }
    return 0;
}