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 <assert.h>
#include <cstring>
#include <iostream>
#include <set>
using int_t = long long int;
using std::cin;
using std::cout;
using std::endl;

const int_t LARGE = 1e4 + 10;

bool check(const int_t* A, int_t n, int_t p) {
    static int_t B[LARGE + 1];
    const int_t phi = p - 1;
    for (int_t i = 0; i <= n; i++)
        B[i % phi] = (B[i % phi] % p + (A[i] % p + p) % p + 2 * p) % p;
    bool ok = true;
    for (int_t i = 0; i < phi; i++) {
        ok = ok && ((B[i] % p + p) % p == 0);
        B[i] = 0;
    }
    return ok;
}
int_t gcd(int_t a, int_t b) {
    if (b == 0) return a;
    return gcd(b, a % b);
}
int main() {
    static bool isPrime[LARGE + 1];
    memset(isPrime, 1, sizeof(isPrime));
    for (int_t i = 2; i <= LARGE; i++) {
        if (isPrime[i]) {
            for (int_t j = i * i; j <= LARGE; j += i) isPrime[j] = false;
        }
    }
    // for (int_t i = 2; i <= LARGE; i++) {
    //     bool has = false;
    //     for (int_t j = i - 1; j >= 2; j--) {
    //         if (i % j == 0 && isPrime[i]) assert(false);
    //         if (i % j == 0) has = true;
    //     }
    //     if (has == 0)
    //         if (isPrime[i] == 0) assert(false);
    // }
    std::set<int_t> result;
    static int_t A[LARGE + 1];
    int_t n;
    scanf("%lld", &n);
    int_t prev = 0;
    for (int_t i = n; i >= 0; i--) {
        scanf("%lld", &A[i]);
        prev = gcd(prev, std::abs(A[i]));
    }
#ifdef DEBUG
    cout << "gcd  = " << prev << endl;
#endif
    for (int_t i = 2; i * i <= prev; i++) {
        if (prev % i == 0) {
            result.insert(i);
            while (prev % i == 0) prev /= i;
        }
    }
    if (prev > 1) result.insert(prev);
    for (int_t i = 2; i <= n; i++)
        if (isPrime[i] && A[0] % i == 0 && check(A, n, i)) {
            result.insert(i);
#ifdef DEBUG
            cout << "got " << i << endl;
#endif
        }

    // for (int_t i  = 0; i <= n; i++)

    for (int_t x : result) {
        printf("%lld\n", x);
        assert(x >= 2);
    }
    return 0;
}