#include <bits/stdc++.h>
using namespace std;
int T = 9, N, sTotal;
map<long long, int> cnt;
map<long long, bool> exist;
long long A[2000010], sta[2000010], Ans = 1;
long long gcd(long long a, long long b) {
  return a % b == 0 ? b : gcd(b, a % b);
}
void Add_Divisors(long long x) {
  long long i;
  for (i = 1; i * i <= x; ++i)
    if (x % i == 0) {
      if (!exist[i]) {
        sta[++sTotal] = i;
        exist[i] = 1;
      }
      if (i * i < x)
        if (!exist[x / i]) {
          sta[++sTotal] = x / i;
          exist[x / i] = 1;
        }
    }
}
long long Max(long long a, long long b) { return a > b ? a : b; }
int main() {
  int i, j;
  srand(19960527);
  scanf("%d", &N);
  for (i = 1; i <= N; ++i) scanf("%I64d", &A[i]);
  for (; T; --T) {
    int to = (rand() * 12341 + rand()) % N + 1;
    sTotal = 0;
    Add_Divisors(A[to]);
    for (i = 1; i <= N; ++i) {
      long long nv = gcd(A[to], A[i]);
      ++cnt[nv];
    }
    sort(sta + 1, sta + sTotal + 1);
    for (i = 1; i <= sTotal; ++i) {
      for (j = i + 1; j <= sTotal; ++j)
        if (sta[j] % sta[i] == 0) cnt[sta[i]] += cnt[sta[j]];
      if (2 * cnt[sta[i]] >= N) Ans = Max(Ans, sta[i]);
    }
    cnt.clear();
    exist.clear();
  }
  cout << Ans << endl;
  return 0;
}
