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 <cstring>
#include <iostream>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>

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

int N;
int64_t a[10000 + 1];

std::vector<int> primes;
std::set<int> ans;

void MakePrime() {
  primes.push_back(2);
  for (int i = 3; i <= 10000; i += 2) {
    bool is_prime = true;
    for (int p : primes) {
      if (i % p == 0) {
        is_prime = false;
        break;
      }
    }
    if (is_prime) primes.push_back(i);
  }
}

int64_t GetMod(int v, int m) {
  if (v < 0) return m + v % m;
  return v % m;
}

bool IsMultipleExprInMod(int p) {
  static int64_t w[10000 + 1];

  std::memcpy(w, a, sizeof(int64_t) * (N + 1));
  // std::cout << p << std::endl;
  for (int i = N - p; i >= 0; i--) {
    // for(int k = 0; k <= N; k++) std::cerr << w[k] << ", ";
    // std::cerr << std::endl;
    int64_t v = GetMod(w[N - (i + p)], p);
    w[N - (i + p)] = GetMod(w[N - (i + p)] - v, p);
    w[N - (i + 1)] = GetMod(w[N - (i + 1)] + v, p);
  }
  // for(int k = 0; k <= N; k++) std::cerr << w[k] << ", ";
  // std::cerr << std::endl;
  for (int i = 0; i <= N; i++) {
    if (w[i] % p) return false;
  }
  return true;
}

int main() {
  std::string s;
  std::cin >> N;
  for (int i = 0; i <= N; i++) {
    std::cin >> a[i];
  }
  //
  int div = std::abs(a[0]);
  for (int i = 0; i <= N; i++) {
    int v = a[i];
    if (!v) continue;
    div = gcd(div, std::abs(v));
  }
  if (div % 2 == 0) {
    ans.insert(2);
    while (div % 2 == 0) div /= 2;
  }
  for (int i = 3; i <= div; i += 2) {
    if (div % i == 0) {
      ans.insert(i);
      while (div % i == 0) div /= i;
    }
  }
  //
  MakePrime();
  for (int p : primes) {
    if (p > N) break;
    if (IsMultipleExprInMod(p)) ans.insert(p);
  }

  for (int p : ans) std::cout << p << std::endl;
  return 0;
}
