John Doe offered his sister Jane Doe find the gcd of some set of numbers a.

Gcd is a positive integer g, such that all number from the set are evenly divisible by g and there isn't such g' (g' > g), that all numbers of the set are evenly divisible by g'.

Unfortunately Jane couldn't cope with the task and John offered her to find the ghd of the same subset of numbers.

Ghd is a positive integer g, such that at least half of numbers from the set are evenly divisible by g and there isn't such g' (g' > g) that at least half of the numbers from the set are evenly divisible by g'.

Jane coped with the task for two hours. Please try it, too.

Input

The first line contains an integer n (1 ≤ n ≤ 106) showing how many numbers are in set a. The second line contains space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 1012). Please note, that given set can contain equal numbers.

Please, do not write the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the %I64d specifier.

Output

Print a single integer g — the Ghd of set a.

Examples

Input

6
6 2 3 4 5 6


Output

3


Input

5
5 5 6 10 15


Output

5
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 10;
long long a[MAXN], d[MAXN], cnt[MAXN], ans, n, siz;
void cut(long long x) {
  siz = 0;
  for (long long i = 1; i * i <= x; i++) {
    if (x % i == 0) {
      d[++siz] = i;
      if (x != i * i) d[++siz] = x / i;
    }
  }
  memset(cnt, 0, sizeof(cnt));
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long random(long long x, long long y) {
  return (long long)rand() * rand() % (y - x + 1) + x;
}
signed main() {
  srand(time(NULL));
  scanf("%I64d", &n);
  for (long long i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  for (long long T = 1; T <= 10; T++) {
    long long x = a[random(1, n)];
    cut(x);
    sort(d + 1, d + siz + 1);
    for (long long i = 1; i <= n; i++) {
      long long pos = lower_bound(d + 1, d + siz + 1, gcd(x, a[i])) - d;
      cnt[pos]++;
    }
    for (long long i = 1; i <= siz; i++)
      for (long long j = i + 1; j <= siz; j++)
        if (d[j] % d[i] == 0) cnt[i] += cnt[j];
    for (long long i = siz; i >= 1; i--) {
      if (cnt[i] * 2 >= n) {
        ans = max(ans, d[i]);
        break;
      }
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
