import std.conv, std.functional, std.stdio, std.string;
import std.algorithm, std.array, std.bigint, std.complex, std.container, std.math, std.numeric, std.range, std.regex, std.typecons;
import core.bitop;

class EOFException : Throwable { this() { super("EOF"); } }
string[] tokens;
string readToken() { for (; tokens.empty; ) { if (stdin.eof) { throw new EOFException; } tokens = readln.split; } auto token = tokens.front; tokens.popFront; return token; }
int readInt() { return readToken.to!int; }
long readLong() { return readToken.to!long; }
real readReal() { return readToken.to!real; }

bool chmin(T)(ref T t, in T f) { if (t > f) { t = f; return true; } else { return false; } }
bool chmax(T)(ref T t, in T f) { if (t < f) { t = f; return true; } else { return false; } }

int binarySearch(alias pred, T)(in T[] as) { int lo = -1, hi = cast(int)(as.length); for (; lo + 1 < hi; ) { const mid = (lo + hi) >> 1; (unaryFun!pred(as[mid]) ? hi : lo) = mid; } return hi; }
int lowerBound(T)(in T[] as, T val) { return as.binarySearch!(a => (a >= val)); }
int upperBound(T)(in T[] as, T val) { return as.binarySearch!(a => (a > val)); }


class XRand {
  uint x = 314159265, y = 358979323, z = 846264338, w = 327950288;
  void setSeed(uint seed) { w ^= seed * 65535; }
  uint next() { uint t = x ^ x << 11; x = y; y = z; z = w; return w = w ^ w >> 19 ^ t ^ t >> 8; }
  uint nextUInt(uint m) { return next() % m; }
  int nextInt(int a, int b) { return a + nextUInt(b - a + 1); }
  ulong nextULong(ulong m) { return (next() | cast(ulong)(next()) << 32) % m; }
  long nextLong(long a, long b) { return a + nextULong(b - a + 1); }
  real nextReal() { return next() / 4294967296.0; }
}


enum LIM = 10^^5;

int N;
long[] A;

void main() {
  auto rng = new XRand();
  
  auto isnp = new bool[LIM];
  foreach (p; 2 .. LIM) {
    if (!isnp[p]) {
      for (int n = 2 * p; n < LIM; n += p) {
        isnp[n] = true;
      }
    }
  }
  
  try {
    for (; ; ) {
      N = readInt();
      A = new long[N + 1];
      foreach_reverse (i; 0 .. N + 1) {
        A[i] = readLong();
      }
      
      long[] ans;
      
      long g;
      foreach (i; 0 .. N + 1) {
        g = gcd(g, abs(A[i]));
      }
      long gg = g;
      for (long p = 2; p * p <= gg; ++p) {
        if (gg % p == 0) {
          ans ~= p;
          do {
            gg /= p;
          } while (gg % p == 0);
        }
      }
      if (gg > 1) {
        ans ~= gg;
      }
      
      A[] /= g;
      debug {
        writeln("ans = ", ans);
        writeln("A = ", A);
      }
      
      long a;
      foreach (i; 0 .. N + 1) {
        if (A[i] != 0) {
          a = A[i];
          break;
        }
      }
      assert(a != 0);
      
      foreach (p; 2 .. N + 1) {
        if (!isnp[p]) {
          if (2 * a % p == 0) {
            auto xs = iota(p).array;
            foreach (i; 1 .. p) {
              swap(xs[rng.nextUInt(i)], xs[i]);
            }
            debug {
              writeln("  p = ", p);
              writeln("  xs = ", xs);
            }
            bool ok = true;
            foreach (x; xs) {
              long y;
              foreach_reverse (i; 0 .. N + 1) {
                y = (y * x + A[i]) % p;
              }
              if (y != 0) {
                ok = false;
                break;
              }
            }
            if (ok) {
              ans ~= p;
            }
          }
        }
      }
      
      
      ans.sort().uniq.array;
      foreach (p; ans) {
        writeln(p);
      }
    }
  } catch (EOFException e) {
  }
}
