#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
 
#define mod 1000000007
#define FOR(x,to) for(int x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define long long long
inline int rei(){int x;cin>>x;return x;}
inline long rel(){long x;cin>>x;return x;}
inline string res(){string x;cin>>x;return x;}
//-------------------------------------------------------
struct PrimeFactor{
    vector<int> LowestPrimeFactor;
    vector<int> Prime;
    int N;
    PrimeFactor(int N0){
        N = N0;
        N++;
        LowestPrimeFactor.resize(N);
        for(int i=1;i<N;i++){
            LowestPrimeFactor[i] = i;
        }
        for(int i=2;i<N;i++){
            if(LowestPrimeFactor[i] == i){
                Prime.push_back(i);
            }
            for(int j=0;j<Prime.size();j++){
                if(Prime[j]*i < N && Prime[j] <= LowestPrimeFactor[i]){
                    LowestPrimeFactor[Prime[j]*i] = Prime[j];
                }
                else{
                    break;
                }
            }
        }
    }
	//基本Nの2乗以下まで
    vector<int> PrimeDivide(int X0){
        vector<int> ans;
        int X = X0;
        int i=0;
        while(X >= N){
            if(X % Prime[i] == 0){
                ans.push_back(Prime[i]);
                X /= Prime[i];
            }
            else{
                i++;
                if(i == Prime.size()){
                    ans.push_back(X);
                    X = 1;
                }
            }
        }
        while(X != 1){
            ans.push_back(LowestPrimeFactor[X]);
            X /= LowestPrimeFactor[X];
        }
        return ans;
    }
    vector<int> Divisor(int X0){
        vector<int> ans;
        int X = X0;
        ans.push_back(1);
        int i=0;
        while(X >= N){
            if(X % Prime[i] == 0){
                int p = Prime[i];
                int c = 0;
                while(X % p == 0){
                    X /= p;
                    c++;
                }
                int l = ans.size();
                int d = p;
                for(int k=1;k<=c;k++){
                    for(int j=0;j<l;j++){
                        ans.push_back(d*ans[j]);
                    }
                    d *= p;
                }
            }
            else{
                i++;
                if(i == Prime.size()){
                    int l = ans.size();
                    for(int j=0;j<l;j++){
                        ans.push_back(X*ans[j]);
                    }   
                    X = 1;
                }
            }
        }
        while(X != 1){
            int p = LowestPrimeFactor[X];
            int c = 0;
            while(X % p == 0){
                X /= p;
                c++;
            }
            int l = ans.size();
            int d = p;
            for(int k=1;k<=c;k++){
                for(int j=0;j<l;j++){
                    ans.push_back(d*ans[j]);
                }
                d *= p;
            }
        }
        return ans;
    }
    int Phi(int X0){
        int ans = X0;
        int X = X0;
        int i=0;
        while(X >= N){
            if(X % Prime[i] == 0){
                int p = Prime[i];
                while(X % p == 0){
                    X /= p;
                }
                ans /= p;
                ans *= p-1;
            }
            else{
                i++;
                if(i == Prime.size()){
                    int p = X;
                    ans /= p;
                    ans *= p-1;
                    X = 1;
                }
            }
        }
        while(X != 1){
            int p = LowestPrimeFactor[X];
            while(X % p == 0){
                X /= p;
            }
            ans /= p;
            ans *= p-1;
        }
        return ans;
    }
};
int gcd(int x,int y){
	if(y == 0){
		return x;
	}
	return gcd(y,x%y);
}
long A[10001];
long D[10001];
void Calc(){
	int N = rei();
	for(int i=0;i<=N;i++){
		A[N-i] = rei();
	}
	PrimeFactor Prime(1000000);
	int g = 0;
	for(int i=0;i<=N;i++){
		g = gcd(max(A[i],-A[i]),g);
	}
	for(int i=0;i<=N;i++){
		A[i] /= g;
	}
	vector<int> ans;
	{
		vector<int> x = Prime.PrimeDivide(g);
		for(int v : x){
			ans.push_back(v);
		}
	}
	for(int i=0;i<Prime.Prime.size();i++){
		if(Prime.Prime[i] > N){
			break;
		}
		int p = Prime.Prime[i];
		for(int j=0;j<=N;j++){
			D[j] = (A[j] + 1000000000LL*p) % p;
		}
		for(int j=N;j>=p;j--){
			D[j-p+1] = (D[j-p+1] + D[j]) % p;
		}
		bool OK = true;
		for(int j=0;j<p;j++){
			OK &= D[j] == 0;
		}
		if(OK){
			ans.push_back(p);
		}
	}
	if(ans.size() == 0){
		return;
	}
	sort(ans.begin(),ans.end());
	cout << ans[0] << "\n";
	for(int i=1;i<ans.size();i++){
		if(ans[i] != ans[i-1]){
			cout << ans[i] << "\n";
		}
	}
}
int main(int argc,char** argv){
	ios::sync_with_stdio(false), cin.tie(0);
	cout.tie(0); Calc(); return 0;
}

Measured memory_bytes: 4860