#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long q = 0;
  char ch = ' ';
  while (ch < '0' || ch > '9') ch = getchar();
  while (ch >= '0' && ch <= '9')
    q = q * 10 + (long long)(ch - '0'), ch = getchar();
  return q;
}
const int N = 1000005;
long long a[N], b[10005], ans;
int n, cnt[10005];
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
int main() {
  srand(19260817);
  n = read(), ans = 1;
  for (register int i = 1; i <= n; ++i) a[i] = read();
  for (register int kas = 1; kas <= 12; ++kas) {
    int x = 1LL * rand() * rand() % n + 1, js = 0;
    for (long long i = 1; i * i <= a[x]; ++i)
      if (a[x] % i == 0) {
        b[++js] = i;
        if (i * i != a[x]) b[++js] = a[x] / i;
      }
    for (register int i = 1; i <= js; ++i) cnt[i] = 0;
    sort(b + 1, b + 1 + js);
    for (register int i = 1; i <= n; ++i)
      ++cnt[lower_bound(b + 1, b + 1 + js, gcd(a[i], a[x])) - b];
    for (register int i = 1; i <= js; ++i) {
      if (b[i] <= ans) continue;
      for (register int j = i + 1; j <= js; ++j)
        if (b[j] % b[i] == 0) cnt[i] += cnt[j];
      if (cnt[i] >= (n + 1) / 2) ans = b[i];
    }
  }
  printf("%lld\n", ans);
  return 0;
}
