#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std; const int maxn = ; int a[maxn]; int main()
{
int n;
while (~scanf("%d", &n)){
memset(a, , sizeof(a));
int Max = , x;
for (int i = ; i<n; i++){
scanf("%d", &x);
a[x]++;
if (x>Max)
Max = x;
}
int ans = ;
//最大公约数一定在 1-Max 之间
for (int j = Max; j >= ; j--){
int cnt = ;
for (int i = j; i <= Max; i += j){
cnt += a[i];
if (cnt >= )
break;
}
if (cnt >= ){
ans = j;
break;
}
}
printf("%d\n", ans);
}
return ;
}