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>
#define	INF	0x3f3f3f3f
#define	LL	long long
#define	MAXN	10010
using namespace std;
int n, a[MAXN], b[MAXN], c[MAXN], g, p[MAXN], pri[MAXN], cnt;
vector <int> ans; 

template <typename T> void chkmin(T &x, T y){x = min(x, y);}
template <typename T> void chkmax(T &x, T y){x = max(x, y);}
template <typename T> void read(T &x){
	x = 0; int f = 1; char ch = getchar();
	while (!isdigit(ch)) {if (ch == '-') f = -1; ch = getchar();}
	while (isdigit(ch)) {x = x * 10 + ch - '0'; ch = getchar();}
	x *= f;
}

int gcd(int a, int b){
	if (a == 0 || b == 0) return a | b;
	return gcd(b, a % b);
}

void fj(int x){
	if (x < 2) return;
	int y = x;
	for (int i = 2; i * i <= y; ++i){
		if (x % i) continue;
		ans.push_back(i);
		while (x % i == 0) x /= i;
	}
	if (x != 1) ans.push_back(x);
}

void init(int n){
	for (int i = 2; i <= n; ++i){
		if (!p[i]) p[i] = i, pri[++cnt] = i;
		for (int j = 1; j <= cnt && pri[j] * i <= n && pri[j] <= p[i]; ++j)
			p[pri[j] * i] = pri[j];
	}
}

void work(int p){
	for (int i = 0; i < n; ++i){
		b[i] = a[i + 1] % p;
		if (b[i] < 0) b[i] += p;
	}
	for (int i = n - p; i >= 0; --i){
		c[i] = b[i + p - 1];
		b[i + p - 1] = 0;
		b[i] = (b[i] + c[i] >= p) ? (b[i] + c[i] - p) : (b[i] + c[i]);
	}
	for (int i = 0; i < n; ++i)
		if (b[i]) return;
	ans.push_back(p);
}

int main(){
	read(n);
	init(n);
	g = 0;
	for (int i = n; i >= 0; --i)
		read(a[i]), g = gcd(g, abs(a[i]));
	fj(g);
	for (int i = 1; i <= cnt; ++i)
		if (a[0] % pri[i] == 0) work(pri[i]);
	sort(ans.begin(), ans.end());
	for (unsigned i = 0, si = ans.size(); i < si; ++i)
		if (!i || ans[i] != ans[i - 1]) printf("%d\n", ans[i]);
	return 0;
}