#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

struct ModInt {
  using M = ModInt;
  unsigned v;
  static unsigned P;
  ModInt() : v(0) {}
  ModInt(auto x) : v(x >= 0 ? x % P : (P - -x % P) % P) {}
  constexpr ModInt(unsigned v, int) : v(v) {}
  M operator+() const { return *this; }
  M operator-() const { return {v ? P - v : 0, 0}; }
  explicit operator bool() const noexcept { return v; }
  bool operator!() const noexcept { return !(bool) *this; }
  M operator*(M r) const { return M(*this) *= r; }
  M operator/(M r) const { return M(*this) /= r; }
  M operator+(M r) const { return M(*this) += r; }
  M operator-(M r) const { return M(*this) -= r; }
  bool operator==(M r) const { return v == r.v; }
  bool operator!=(M r) const { return !(*this == r); }
  M& operator*=(M r) { v = (uint64_t) v * r.v % P; return *this; }
  M& operator/=(M r) { return *this *= r.inv(); }
  M& operator+=(M r) { if ((v += r.v) >= P) v -= P; return *this; }
  M& operator-=(M r) { if ((v += P - r.v) >= P) v -= P; return *this; }
  M inv() const {
    int a = v, b = P, x = 1, u = 0;
    while (b) {
      int q = a / b;
      swap(a -= q * b, b);
      swap(x -= q * u, u);
    }
    assert(a == 1);
    return x;
  }
  M pow(auto n) const {
    if (n < 0) return pow(-n).inv();
    M res = 1;
    for (M a = *this; n; a *= a, n >>= 1) if (n & 1) res *= a;
    return res;
  }
  friend M operator*(auto l, M r) { return M(l) *= r; }
  friend M operator/(auto l, M r) { return M(l) /= r; }
  friend M operator+(auto l, M r) { return M(l) += r; }
  friend M operator-(auto l, M r) { return M(l) -= r; }
  friend ostream& operator<<(ostream& os, M r) { return os << r.v; }
  friend istream& operator>>(istream& is, M& r) { lint x; is >> x; r = x; return is; }
  friend bool operator==(auto l, M r) { return M(l) == r; }
  friend bool operator!=(auto l, M r) { return !(l == r); }
};
using Mint = ModInt;
unsigned Mint::P;

template<class Z> bool is_prime(Z n) {
  if (n < 2 or n > 2 and ~n & 1) return false;
  for (Z i = 3; i * i <= n; i += 2) if (n % i == 0) return false;
  return true;
}
template<class Z> map<Z, int> factorize(Z n) {
  map<Z, int> res;
  for (Z i = 2; i * i <= n; ++i) while (n % i == 0) ++res[i], n /= i;
  if (n != 1) ++res[n];
  return res;
}

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  int n; cin >> n;
  V<> a(n + 1);
  for (int i = n; i >= 0; --i) cin >> a[i];
  int d = accumulate(begin(a), end(a), 0, [](int init, int x) { return __gcd(init, abs(x)); });
  V<> res;
  for (const auto& e : factorize(d)) {
    res.push_back(e.first);
  }
  for (int p = 2; p <= n; ++p) if (is_prime(p)) {
    Mint::P = p;
    V<Mint> c(n + 1);
    for (int i = 0; i <= n; ++i) c[i] = a[i];
    if (c[0]) continue;
    c.erase(begin(c));
    while ((int)c.size() >= p) {
      c[(int)c.size() - p] += c.back();
      c.pop_back();
    }
    while (!c.empty() and !c.back()) c.pop_back();
    if (c.empty()) res.push_back(p);
  }
  sort(begin(res), end(res));
  res.erase(unique(begin(res), end(res)), end(res));
  for (int e : res) cout << e << '\n';
}

Measured memory_bytes: 384