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;

vector<int> sieve(int n){
    vector<int> ret;
    vector<bool> is_prime(n+1);
    for(int i=2; i<=n; i++) is_prime[i] = true;
    for(int i=2; i<=n; i++){
        if(is_prime[i]){
            ret.push_back(i);
            for(int j=2*i; j<=n; j+=i) is_prime[j] = false;
        }
    }
    return ret;
}

int main(){
    int N;
    int A[10001];
    cin >> N;
    for(int i=N; i>=0; i--) cin >> A[i];

    auto cand = sieve(N);

    int a = abs(A[N]);
    for(int p=2; p*p<=a; p++){
        if(a % p == 0){
            if(p > N) cand.push_back(p);
            while(a % p == 0) a /= p;
        }
    }
    if(a > N) cand.push_back(a);

    for(int p : cand){
        if(A[0] % p) continue;
        vector<int64_t> sum(N+1, 0);
        for(int i=1; i<=N; i++){
            int d = (i-1) % (p-1) + 1;
            sum[d] += A[i];
        }
        bool ok = true;
        for(int i=1; i<=N; i++) if(sum[i] % p) ok = false;
        if(ok) cout << p << endl;
    }
    return 0;
}
