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 <algorithm>
#include <set>

using namespace std;
typedef vector<int> vi;
typedef long long ll;
#define FORE(x,xs) for (auto& x : xs)

bool isPrime(int n) {
    if (n&1 == 0) return false;
    for (int i = 3; 1ll * i * i <= n; i += 2)
        if (n%i == 0) return false;
    return true;
}

vi getDivs(int n) {
    vi divs;
    for (ll i = 2; i*i <= n; i++) {
        if (n%i == 0) {
            divs.push_back(i);
            while (n%i == 0) n /= i;
        }
    }
    if (n != 1) divs.push_back(n);
    return divs;
}

int gcd (int a, int b) {
    if (a > b) swap(a, b);
    while (a) {
        int k = b%a;
        b = a;
        a = k;
    }
    return b;
}

const int MAX = 1e4+10;

vi primes;
int N;
ll A[MAX];

bool check(ll p) {
    vector<ll> c(p-1);
    if (A[0] % p != 0) return false;
    for (int n = 1; n <= N; n++) c[n%(p-1)] += A[n];
    for (int i = 0; i < p-1; i++) if (c[i] % p != 0) return false;
    return true;
}

int main() {
    primes.push_back(2);
    cin >> N;
    for (int i = 3; i <= N; i += 2) if (isPrime(i)) primes.push_back(i);
    for (int i = N; i >= 0; i--) cin >> A[i];

    set<int> ans;

    int d = abs(A[0]);
    for (int i = 0; i <= N; i++) d = gcd(d, abs(A[i]));
    vi v = getDivs(d);
    FORE (x, v) ans.insert(x);

    FORE (p, primes) if (check(p)) {
        ans.insert(p);
    }

    vi ans_v;
    copy(ans.begin(), ans.end(), std::back_inserter(ans_v));
    sort(ans_v.begin(), ans_v.end());

    FORE (a, ans_v) cout << a << endl;
}