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;

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

bool check(long long q, vector<long long> a) {
    int n = a.size();
    // divide x^q - x;
    for (int i = 0; i < n; i++) {
        a[i] = (a[i] % q + q) % q;
        int c = i + (int) q - 1;
        if (c < n - 1) {
            a[c] = (a[c] % q + q) % q;
            a[c] += a[i];
            a[c] %= q; a[i] = 0;
        }
        if (a[i]) return false;
    }
    return true;
}

vector<bool> Eratosthenes(int n){
	vector<bool> prime(n+1, true);
	if(n >= 0) prime[0] = false;
	if(n >= 1) prime[1] = false;
	for(int i = 2; i * i <= n; i++){
		if(prime[i]){
			for(int j = i + i; j <= n; j += i) prime[j] = false;
		}
	}
    return prime;
}

int main() {
    int n; cin >> n;
    vector<long long> a(n+1);
    vector<long long> ans;
    for (int i = 0; i <= n; i++) {
        cin >> a[i];
    }
    long long d = abs(a[0]);
    for (int i = 0; i <= n; i++) {
        if (a[i]) d = gcd(d, abs(a[i]));
    }
    //cout << " " << d << endl;
    vector<long long> u;
    if (d >= 2) {
        for (long long c = 2; c * c <= d; c++) {
            if (d % c == 0) {
                u.emplace_back(c);
                while (d % c == 0) d /= c;
            }
        }
        if (d != 1) u.emplace_back(d);
        if (!u.empty()) for (auto q: u) {
            ans.emplace_back(q);
        }
    }
    auto prime = Eratosthenes(n+10);
    for (int i = 2; i <= n; i++) {
        if (prime[i]) {
            if (check((long long) i, a)) ans.emplace_back((long long) i);
        }
    }
    sort(ans.begin(), ans.end());
    ans.erase(unique(ans.begin(), ans.end()), ans.end());
    if (ans.empty()) return 0;
    for (int i = 0; i < ans.size(); i++) {
        cout << ans[i] << endl;
    }
    return 0;
}