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;
int _max(int x, int y) {return x > y ? x : y;}
int _min(int x, int y) {return x < y ? x : y;}
const int N = 10001;
int read() {
	int s = 0, f = 1; char ch = getchar();
	while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}
	while(ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
	return s * f;
}
void put(int x) {
	if(x >= 10) put(x / 10);
	putchar(x % 10 + '0');
}

int n, a[N];
int plen, p[N];
int tp, ans[N * 2], sum[N];
bool v[N];

int gcd(int a, int b) {return b == 0 ? a : gcd(b, a % b);}

void get_p(int n) {
	for(int i = 2; i <= n; i++) {
		if(!v[i]) p[++plen] = i;
		for(int j = 1; j <= plen && (LL)i * p[j] <= n; j++) {
			v[i * p[j]] = 1;
			if(i % p[j] == 0) break;
		}
	}
}

int add(int x, int y, int mod) {
	x += y;
	return x >= mod ? x - mod : x;
}

bool check(int mod) {
	for(int i = 0; i < mod - 1; i++) sum[i] = 0;
	for(int i = 0; i <= n; i++) sum[i % (mod - 1)] = add(sum[i % (mod - 1)], (a[i] % mod + mod) % mod, mod);
	for(int i = 0; i < mod - 1; i++) if(sum[i]) return 0;
	return 1;
}

int main() {
	n = read();
	get_p(n);
	for(int i = n; i >= 0; i--) a[i] = read();
	int cc = abs(a[n]); for(int i = n - 1; i >= 0; i--) if(a[i]) cc = gcd(cc, abs(a[i]));
	for(int i = 2; i * i <= cc; i++) if(cc % i == 0){
		while(cc % i == 0) cc /= i;
		ans[++tp] = i;
	} if(cc > 1) ans[++tp] = cc;
	for(int i = 1; i <= plen; i++) if(a[0] % p[i] == 0 && check(p[i])) ans[++tp] = p[i];
	sort(ans + 1, ans + tp + 1);
	tp = unique(ans + 1, ans + tp + 1) - (ans + 1);
	for(int i = 1; i <= tp; i++) put(ans[i]), puts("");
	return 0;
}
