# 题目

n ⩽ 1 0 5 n\leqslant 10^5 1 ⩽ λ i ⩽ 1 0 9 1\leqslant\lambda_i\leqslant 10^9

# 代码

#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cctype>
#include <random>
#include <map>
using namespace std;
#define rep(i,a,b) for(int i=(a); i<=(b); ++i)
#define drep(i,a,b) for(int i=(a); i>=(b); --i)
typedef long long llong;
inline llong readint(){

llong a = 0; int c = getchar(), f = 1;
for(; !isdigit(c); c=getchar())
if(c == '-') f = -f;
for(; isdigit(c); c=getchar())
a = (a<<3)+(a<<1)+(c^48);
return a*f;
}
inline llong getGcd(llong a,llong b){

for(; true; b%=a){

if(b == 0) return a;
if((a %= b) == 0) return b;
}
return 0; // what the heck
}

const int MAXN = 200005;
llong a[MAXN];

const int SQRTA = 1000000;
int primes[SQRTA+5], primes_size;
bool isPrime[SQRTA+5];
void sieve(int n = SQRTA){

memset(isPrime+2,true,n-1);
for(int i=2; i<=n; ++i){

if(isPrime[i]) primes[++ primes_size] = i;
for(int j=1; j<=primes_size&&primes[j]<=n/i; ++j)
isPrime[i*primes[j]] = false;
}
}

const int LOGA = 50;
int zs[LOGA], coe[LOGA], tot;
map<llong,int> haxi; ///< from divisor to index
void get_factor(llong x){

tot = 0; coe[0] = 1, zs[0] = 0;
static vector< pair<llong,int> > _tmp;
haxi.clear(); _tmp.clear();
haxi[1] = 0; // the only survivor
for(int i=1; i<=primes_size&&primes[i]<=x/primes[i]; ++i){

if(x%primes[i]) continue; // no such thing
for(++tot,zs[tot]=0; !(x%primes[i]); )
x /= primes[i], ++ zs[tot];
coe[tot] = coe[tot-1]*(zs[tot-1]+1);
for(auto it : haxi){

llong v = it.first; int _id = it.second;
for(int j=1; j<=zs[tot]; ++j){

v *= primes[i], _id += coe[tot];
_tmp.push_back(make_pair(v,_id));
}
}
for(; !_tmp.empty(); _tmp.pop_back())
haxi[_tmp.back().first] = _tmp.back().second;
}
if(x == 1) return ;
zs[++ tot] = 1, coe[tot] = coe[tot-1]*(zs[tot-1]+1);
for(auto it : haxi) // consider this big divisor
_tmp.push_back(make_pair(it.first*x,it.second+coe[tot]));
for(; !_tmp.empty(); _tmp.pop_back())
haxi[_tmp.back().first] = _tmp.back().second;
}

int cnt[SQRTA<<1];
int main(){

sieve(); // maybe optimization backwards ...
mt19937 rnd; // rander
rnd.seed((unsigned)1983);
int n = int(readint());
uniform_int_distribution<int> _sy(1,n<<1);
rep(i,1,n<<1) a[i] = readint();
llong ans = 1; // real answer
for(int cs=20; cs; --cs){

const int pivot = _sy(rnd);
get_factor(a[pivot]);
const int all = coe[tot+1] = coe[tot]*(zs[tot]+1);
memset(cnt,0,all<<2); // clear
rep(i,1,n<<1) ++ cnt[haxi[getGcd(a[i],a[pivot])]];
rep(i,1,tot) drep(j,all-1,0)
if((j%coe[i+1])/coe[i] != zs[i])
cnt[j] += cnt[j+coe[i]];
for(auto it=haxi.rbegin(); it!=haxi.rend(); ++it)
if(cnt[it->second] >= n){

ans = max(ans,it->first); break;
}
}
printf("%lld\n",ans);
return 0;
}