#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

//改造
typedef long long int ll;
using ll = long long int;
using ull = long long unsigned int;
using Int = long long int;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//ここから編集する
class Solve {
public:
    set<Int> sobun(Int n) {
        set<Int> ret;
        while (n % 2 == 0) {
            n /= 2;
            ret.insert(2);
        }

        Int div = 3;
        while (n > 1) {
            if (n % div == 0) {
                n /= div;
                ret.insert(div);
            } else {
                if (div * div > n) {
                    ret.insert(n);
                    break;
                }
                div += 2;
            }
        }
        return ret;
    }

    ll gcd(ll a, ll b) {
        if (a < b) swap(a, b);
        if (b == 0) return a;
        if (a % b == 0) return b;
        return gcd(b, a % b);

    }

    void solve() {
        int N;
        cin >> N;
        vector<Int> a(N + 1);
        for (int i = N; i >= 0; --i) {
            cin >> a[i];
        }

        Int g = abs(a[0]);
        for (int i = 1; i <= N; ++i) {
            g = gcd(g, abs(a[i]));
        }

        set<Int> ans = sobun(g);
        for (int i = 0; i <= N; ++i) {
            a[i] /= g;
        }

//        set<Int> kouho;
//        for (int i = 0; i <= N; ++i) {
//            if (a[i] != 0) {
////                kouho = sobun(abs(a[i]));
////                break;
//                auto kk = sobun(abs(a[i]));
//                kouho.insert(all(kk));
//            }
//        }

        auto is_in = [&](int p) {
            // p is prime
            vector<Int> b(p - 1);
            for (int i = 0; i <= N; ++i) {
                Int nene = a[i];
//                b[i % (p - 1)] += ((a[i] % p) + p) % p;
                Int &bip = b[i % (p - 1)];
//                b[i % (p - 1)] += a[i];
//                b[i % (p - 1)] %= p;
                bip = ((bip + a[i]) % p + p) % p;
            }

            for (auto e : b) {
                if (e % p != 0) return false;
            }
            return a[0] % p == 0;
        };

        Int max_P = N + 1;
        vector<bool> prime(max_P + 1, true);
        prime[0] = prime[1] = false;
        for (int i = 2; i <= max_P; ++i) {
            if (prime[i]) {
                for (int j = 2 * i; j <= max_P; j += i) {
                    prime[j] = false;
                }
            }
        }

        for (int e = 0; e <= max_P; ++e) {
            if (prime[e])
                if (is_in(e)) {
                    ans.insert(e);
                }
        }

//        for (auto e : kouho) {
//            if (sobun(e).size() == 1) {
//                if (is_in(e)) {
//                    ans.insert(e);
//                }
//            }
//        }

        for (auto e : ans) {
            cout << e << endl;
        }

    }
};


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    Solve().solve();


    return 0;
}


Measured memory_bytes: 512