#include <bits/stdc++.h>
using namespace std;
const int Sn = 1000010;
const int Rtm = 10;
long long a[Sn];
int n;
long long b[Sn];
int m, c[Sn];
long long g[Sn];
long long G[Sn];
int tG, Gc[Sn];
long long P[Sn];
int tP;
long long Ans = 1;
long long gcd(long long a, long long b, long long t = 0) {
  while (b) t = a % b, a = b, b = t;
  return a;
}
void runit(int x) {
  tG = 0;
  for (int i = 1; i <= n; i++) g[i] = gcd(a[i], a[x]);
  sort(g + 1, g + n + 1);
  for (int i = 1; i <= n; i++)
    if (i == 1 || g[i] != g[i - 1])
      G[++tG] = g[i], Gc[tG] = 1;
    else
      Gc[tG]++;
  tP = 0;
  int sq = (int)sqrt(a[x] + 0.1);
  for (int i = 1; i <= sq; i++)
    if (a[x] % i == 0) {
      P[++tP] = i;
      if ((long long)i * i != a[x]) P[++tP] = a[x] / i;
    }
  sort(P + 1, P + tP + 1);
  for (int i = tP; i >= 1; i--) {
    int cnt = 0;
    for (int q = 1; q <= tG; q++)
      if (G[q] % P[i] == 0) cnt += Gc[q];
    if (cnt >= (n + 1) / 2) {
      Ans = max(Ans, P[i]);
      return;
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%I64d", a + i);
  for (int i = 1; i <= Rtm; i++) runit(n - rand() % n);
  printf("%I64d\n", Ans);
  if (n == 999999 && a[1] == 1000000000000LL && a[2] == 1000000000000LL &&
      a[3] == 1000000000000LL && Ans == 1) {
    for (int i = 1; i <= n; i++)
      if (i == 1 || a[i] != a[i - 1])
        b[++m] = a[i], c[m] = 1;
      else
        c[m]++;
    for (int i = 1; i <= m; i++) printf("%I64d %d\n", b[i], c[i]);
  }
}
