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<bool> is_prime_list;
vector<long long int> Eratosthenes_Sieve(int n){// list of primes smaller than n
    is_prime_list.resize(n+1, true);
    is_prime_list[0] = false; 
    is_prime_list[1] = false;

    vector<long long int> primes;
    for (int i=2; i<=n; i++) {
        if (is_prime_list[i] == true){
            primes.push_back(i);
            for (int j=i*2; j<=n; j+=i){
                is_prime_list[j] = false;// exclude multipliers of i (prime)
            }
        }// if not prime, do nothing -> proceed to i+1
    }
    return primes;
}

int main(){
    int n;
    cin >> n;

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

    // list up candidates
    vector<long long int> prime_factor = Eratosthenes_Sieve(n);

    int m = abs(a[n]);
    for (int p=2; p*p<=m; p++) {
        if(m % p != 0) continue;

        while(m % p == 0) m /= p;
        if(p >= n) prime_factor.push_back(p);
    }
    if(m != 1 && m >= n) prime_factor.push_back(m);

    // verify each
    for(long long int pf : prime_factor){
        if(a[0] % pf != 0) continue;

        bool flag = true;
        if(n <= pf - 1){
            for(int i=1; i<=n; i++){
                if(a[i] % pf != 0) flag = false;
            }
        }
        else{
            vector<long long int> coeff(pf-1);
            for(int i=1; i<=n; i++){
                coeff[i%(pf-1)] += a[i];
                coeff[i%(pf-1)] = (coeff[i%(pf-1)] % pf + pf) % pf;
            }
            for(int i=0; i<pf-1; i++){
                if(coeff[i] % pf != 0) flag = false;
            }
        }

        if(flag == false) continue;
        cout << pf << endl;
    }
    return 0;
}