#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 79;
vector<int> a(maxn), cnt(maxn), u(maxn, 0), is(maxn, 0);
vector<vector<int> > d(maxn);
void update_cnt(int in, int delta) {
  for (int j : d[in]) cnt[j] += delta;
}
int gcd(int a, int b) {
  if (a < b) swap(a, b);
  while (b) {
    int c = a % b;
    a = b;
    b = c;
  }
  return a;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  for (int i = 0; i < maxn; i++) {
    int pr = 0, a = i, sq = 0;
    for (int j = 1; j * j <= i; j++) {
      if (j > 1 && a % j == 0) {
        pr++;
        while (a % j == 0) a /= j;
      }
      if (j > 1 && i % (j * j) == 0) sq = 1;
      if (i % j == 0) {
        d[i].push_back(j);
        if (j * j < i) d[i].push_back(i / j);
      }
    }
    if (a > 1) pr++;
    u[i] = (sq ? 0 : (pr % 2 == 0 ? 1 : -1));
    sort(d[i].begin(), d[i].end());
  }
  int n;
  cin >> n;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ans = max(ans, (long long)a[i]);
    is[a[i]] = 1;
  }
  for (int mygcd = 1; mygcd < maxn; mygcd++) {
    vector<int> st;
    for (int j = ((maxn - 1) / mygcd); j; j--) {
      if (!is[j * mygcd]) continue;
      int coprime = 0;
      for (int i : d[j]) coprime += u[i] * cnt[i];
      if (coprime) {
        while (coprime) {
          update_cnt(st.back(), -1);
          if (gcd(j, st.back()) == 1) {
            ans = max(ans, (j * 1ll * st.back() * (long long)(mygcd)));
            coprime--;
          }
          st.pop_back();
        }
      }
      update_cnt(j, 1);
      st.push_back(j);
    }
    while (!st.empty()) update_cnt(st.back(), -1), st.pop_back();
  }
  cout << ans << "\n";
  return 0;
}

### Prompt

Your task is to create a cpp solution to the following problem:

Given an array a, consisting of n integers, find:

$$$max_{1 ≤ i < j ≤ n} LCM(a_i,a_j),$$$

where LCM(x, y) is the smallest positive integer that is divisible by both x and y. For example, LCM(6, 8) = 24, LCM(4, 12) = 12, LCM(2, 3) = 6.

Input

The first line contains an integer n (2 ≤ n ≤ 10^5) — the number of elements in the array a.

The second line contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^5) — the elements of the array a.

Output

Print one integer, the maximum value of the least common multiple of two elements in the array a.

Examples

Input


3
13 35 77


Output


1001

Input


6
1 2 4 8 16 32


Output


32

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 79;
vector<int> a(maxn), cnt(maxn), u(maxn, 0), is(maxn, 0);
vector<vector<int> > d(maxn);
void update_cnt(int in, int delta) {
  for (int j : d[in]) cnt[j] += delta;
}
int gcd(int a, int b) {
  if (a < b) swap(a, b);
  while (b) {
    int c = a % b;
    a = b;
    b = c;
  }
  return a;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  for (int i = 0; i < maxn; i++) {
    int pr = 0, a = i, sq = 0;
    for (int j = 1; j * j <= i; j++) {
      if (j > 1 && a % j == 0) {
        pr++;
        while (a % j == 0) a /= j;
      }
      if (j > 1 && i % (j * j) == 0) sq = 1;
      if (i % j == 0) {
        d[i].push_back(j);
        if (j * j < i) d[i].push_back(i / j);
      }
    }
    if (a > 1) pr++;
    u[i] = (sq ? 0 : (pr % 2 == 0 ? 1 : -1));
    sort(d[i].begin(), d[i].end());
  }
  int n;
  cin >> n;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ans = max(ans, (long long)a[i]);
    is[a[i]] = 1;
  }
  for (int mygcd = 1; mygcd < maxn; mygcd++) {
    vector<int> st;
    for (int j = ((maxn - 1) / mygcd); j; j--) {
      if (!is[j * mygcd]) continue;
      int coprime = 0;
      for (int i : d[j]) coprime += u[i] * cnt[i];
      if (coprime) {
        while (coprime) {
          update_cnt(st.back(), -1);
          if (gcd(j, st.back()) == 1) {
            ans = max(ans, (j * 1ll * st.back() * (long long)(mygcd)));
            coprime--;
          }
          st.pop_back();
        }
      }
      update_cnt(j, 1);
      st.push_back(j);
    }
    while (!st.empty()) update_cnt(st.back(), -1), st.pop_back();
  }
  cout << ans << "\n";
  return 0;
}

```