#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
const int T = 11;
long long a[N];
long long gcd(long long a, long long b) {
  if (b > a) swap(a, b);
  return b ? gcd(b, a % b) : a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  mt19937 mt_rand(time(NULL));
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  long long ans = 1;
  for (int i = 0; i < T; i++) {
    int idx = mt_rand() % n, sum = 0;
    vector<long long> div0, div1;
    for (int i = 1; i <= sqrt(a[idx]); i++) {
      if (a[idx] % i == 0) {
        div0.push_back(i);
        if (a[idx] / i != i) div1.push_back(a[idx] / i);
      }
    }
    reverse(div1.begin(), div1.end());
    div0.insert(div0.end(), div1.begin(), div1.end());
    vector<long long> cnt(div0.size());
    for (int i = 0; i < n; i++) {
      int id = lower_bound(div0.begin(), div0.end(), gcd(a[i], a[idx])) -
               div0.begin();
      cnt[id]++;
    }
    for (int i = div0.size() - 1; i >= 0; i--) {
      long long sum = cnt[i];
      for (int j = i + 1; j < div0.size(); j++) {
        if (div0[j] % div0[i] == 0) sum += cnt[j];
      }
      if (sum >= (n + 1) / 2) {
        ans = max(ans, div0[i]);
        break;
      }
    }
  }
  cout << ans << endl;
}
