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<cstdio>
#include<vector>
#include<set>
#include<algorithm>
using namespace std;
typedef long long ll;
int n;
ll a[11000];
vector<ll> prs;
bool ok(ll p)
{
	// ok to check only these values of x
	for (ll x = 0; x <= n && x < p; x++)
	{
		ll f = 0;
		for (int i = n; i >= 0; i--)
			f = (f * x + a[i]) % p;
		if (f % p) return false;
	}
	return true;
}
ll coef[11000][2];
bool ok2(ll p)
{
	memset(coef, 0, sizeof(coef));
	for (int i = 1; i <= n; i++) coef[i][1] = 1;
	bool ret = true;
	for (int k = 1; k <= n; k++)
	{
		ll csum = 0;
		for (int i = k; i <= n; i++)
		{
			csum = (csum + coef[i][k & 1] * a[i]) % p;
			coef[i][!(k & 1)] =
				(i == k) ? 0 : ((coef[i - 1][0] + coef[i - 1][1]) * (k + 1)) % p;
		}
		if (csum % p) {
			ret = false;
			break;
		}
	}
	return ret;
}
bool ok3(ll p)
{
	for (int i = 0; i < p - 1; i++)
	{
		ll t = 0;
		for (int j = i; j <= n; j += p - 1) t = (t + a[j]) % p;
		if (t) return false;
	}
	return true;
}
ll gcd(ll x, ll y)
{
	while (y) { x %= y; swap(x, y); }
	return x < 0 ? -x : x;
}
bool sieve[10100];
int main()
{
	ll m = 0;
	scanf("%d", &n);
	for (int i = n; i >= 0; i--) {
		scanf("%lld", &a[i]); m = gcd(m, a[i]);
	}
	set<ll> ans;
	for (ll p = 2; p * p <= m; p++)
	{
		if (m % p) continue;
		while (!(m % p)) m /= p;
		ans.insert(p);
	}
	if (m > 1) ans.insert(m);
	for (int i = 2; i <= n; i++)
	{
		if (sieve[i]) continue;
		for (int j = i + i; j <= n; j += i) sieve[j] = true;
		//matrix with (i, j) entry i^j mod p is invertible
		if (!(a[0]%i) && ok3(i))
			ans.insert(i);
	}
	for (auto x : ans)
	{
		printf("%lld\n", x);
	}
	return 0;
}
