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;
typedef long long ll;
typedef vector<int> vi;
vi pr;
int v[10100];
unordered_set<int> fac;
void gp() {
	pr.push_back(2);
	pr.push_back(3);
	pr.push_back(5);
	for(int i=5;i<50000;i+=2) {
		int bs = 2;
		while(bs--) {
			bool p = true;
			for(int j=2;pr[j]*pr[j]<=i;j++) {
				if(!(i%pr[j])) {p = false;break;}
			}
			if(p && (i != 5)) {pr.push_back(i);}
			i += 2;
		}
	}
}
int gcd(int a, int b) {
	if(b == 0) return a;
	if(a == 0) return b;
	return gcd(b,a%b);
}
int main() {
	gp();
	int n;
	scanf("%d ",&n);
	n++;
	int g = 0;
	for(int i=0;i<n;i++) {
		int t;
		scanf("%d ",&t);
		v[n-i-1] = t;
		g = gcd(g,abs(t));
	}
	for(int i=0;pr[i]*pr[i]<=g;i++) {
		if(!(g%pr[i])) {
			fac.insert(pr[i]);
			while(!(g%pr[i])) {
				g /= pr[i];
			}
		}
	}
	if(g > 1) {fac.insert(g);}
	for(int i=0;pr[i] <= n;i++) {
	//for(int i=0;pr[i] <= 10000;i++) {
		if(fac.find(pr[i]) != fac.end()) continue;
		if(v[0]%pr[i]) continue;
		vi md(pr[i]-1,0);
		for(int j=0;j<n;j++) {
			md[j%(pr[i]-1)] += v[j]%(pr[i]);
			md[j%(pr[i]-1)] %= pr[i];
		}
		bool po = true;
		for(int j=0;j<pr[i]-1;j++) {
			if(md[j] != 0) {po = false;break;}
		}
		if(po) fac.insert(pr[i]);
	}
	vi res;
	for(auto& it: fac) {
		res.push_back(it);
	}
	sort(res.begin(),res.end());
	for(int i=0;i<res.size();i++) {
		printf("%d\n",res[i]);
	}
}
