#pragma GCC optimize "-O3"
#include<bits/stdc++.h>

using namespace std;

#define pb      push_back
#define sz(x)   x.size()
#define all(x)  x.begin(),x.end()

const int   N   = 1e5 + 1;
const int   mod = 998244353;

typedef vector<int> vi;

int add(int a,int b)    {
    a += b;
    if(a >= mod)a -= mod;
    return  a;
}
int sub(int a,int b)    {
    a -= b;
    if(a <  0)  a += mod;
    return a;
}
int mul(int a,int b)    {
    return (long long)a * b % mod;
}

int qpow(int a,int exp) {
    int ans = 1;
    while (exp) {
        if(exp & 1) ans = mul(ans,a);
        a = mul(a,a);   exp >>= 1;
    }
    return ans;
}

int root[20][2];
int  rev[20][N];

void fft(int n,vi &a,bool inv)      {
	if (n == 1) return;
	for(int i = 0 ; i < n ; ++i)    {
        int j = rev[__builtin_ctz(n)][i];
		if (i < j)  swap(a[i],a[j]);
	}
	for(int k = 1, e = 1 ; k < n ; k <<= 1, ++e)
		for(int i = 0 ; i < n ; i += (k << 1))  {
			int W = 1;
			for(int j = 0 ; j < k ; ++j)    {
				int x = a[i + j], y = mul(a[i + j + k],W);
				a[i + j]     = add(x,y);
				a[i + j + k] = sub(x,y);
				W = mul(W,root[e][inv]);
			}
		}
	if (inv)    {
		int m = qpow(n,mod - 2);
		for(int i = 0 ; i < n ; ++i)
			a[i] = mul(a[i],m);
	}
}

vi  Mul(vi  P,vi  Q)    {
	int need = sz(P) + sz(Q) - 1;
	int n = 1;
	while(n < need) n <<= 1;
	P.resize(n);    fft(n,P,0);
	Q.resize(n);    fft(n,Q,0);
	for(int i = 0 ; i < n ; ++i)
		P[i] = mul(P[i],Q[i]);
	fft(n,P,1); P.resize(need);
	return P;
}

int n, a[N];

int main()  {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    for(int i = 1 ; i < 19 ; ++i)   {
		int e = (mod >> i);
		root[i][0] = qpow(3,e); e = mod - 1 - e;
		root[i][1] = qpow(3,e);
		for(int j = 0 ; j < (1 << i) ; ++j) {
			int x = j;
			for(int k = 0, l = i - 1 ; k < l ; ++k, --l)
				if((x >> k & 1) != (x >> l & 1))    {
					x ^= (1 << k);
					x ^= (1 << l);
				}
			rev[i][j] = x;
		}
	}

    cin >> n;

    for(int i = 0 ; i < n ; ++i)    cin >> a[i];

    sort(a,a + n);

    function<vi(int,int)>   Mull = [&](int l,int r) {
        if (l == r) {
            vi  v = {l,a[l] % mod};
            return v;
        }
        int m = (l + r) / 2;
        return Mul(Mull(l,m),Mull(m + 1,r));
    };

    vi  B = Mull(0,n - 1);

    int ans = 0;
    for(int x : B)  ans = __gcd(ans,x);

    cout << ans << endl;
}
