#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<cmath>
#include<ctime>
#include<complex>

using namespace std;

#define REP(i,s,e) for(int i=int(s);i<=int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)

int g(int a,int b){
	int c=max(a,b),d=min(a,b);
	if(c%d==0) return d;
	else return g(d,c%d);
}
int main(){

	int n,p,q,r;
	cin >> n;

	if(n==2){
		cin >> p >> q;

		REP(i,1,g(p,q))
		if(g(p,q)%i==0) cout << i << endl;

	}

	if(n==3){
		cin >> p >> q >> r;

		REP(i,1,g(g(p,q),r))
		if(g(g(p,q),r)%i==0) cout << i << endl;

	}

	return 0;
}
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cctype>
using namespace std;
void _2();
void _3();
int main(){

    int n;
    scanf("%d",&n);

    (n == 2) ? _2() : _3();

    return 0;
}
void _2(){

    int a,b;
    scanf("%d%d",&a,&b);
    int mi = min(a,b);
    for(int i = 1; i <= mi; i++){
        if(a % i == 0 && b % i == 0){
            printf("%d\n",i);
        }
    }
    return;
}
void _3(){
    int a,b,c;
    scanf("%d%d%d",&a,&b,&c);
    int mi = min(a,min(b,c));
    for(int i = 1; i <= mi; i++){
        if(a % i == 0 && b % i == 0 && c % i == 0){
            printf("%d\n",i);
        }
    }
    return;
}