#include <bits/stdc++.h>
using namespace std;
int n, vis[100005];
vector<int> d[100005], a[100005], p[100005];
void pre() {
  for (int i = 1; i < 100002 + 1; i++) {
    for (int j = i; j <= 100002; j += i) {
      d[j].push_back(i);
    }
  }
  for (int i = 2; i < 100002 + 1; i++) {
    if ((int)p[i].size()) continue;
    for (int j = i; j <= 100002; j += i) {
      p[j].push_back(i);
    }
  }
}
int query(int l, int r, int w) {
  int cur = 0;
  for (int i = 0; i < 1 << (int)p[w].size(); i++) {
    int g = 1;
    for (int j = 0; j < (int)p[w].size(); j++) {
      if ((i >> j) & 1) g *= p[w][j];
    }
    int second = upper_bound((a[g]).begin(), (a[g]).end(), r) -
                 lower_bound((a[g]).begin(), (a[g]).end(), l);
    if (__builtin_popcount(i) % 2)
      cur -= second;
    else
      cur += second;
  }
  return cur;
}
void solve() {
  pre();
  cin >> n;
  for (int i = 0; i < n; i++) {
    int first;
    cin >> first;
    if (vis[first]) continue;
    for (auto j : d[first]) vis[j] = 1;
  }
  for (int i = 1; i < 100002 + 1; i++) {
    if (vis[i] == 0) continue;
    for (auto j : d[i]) a[j].push_back(i);
  }
  long long ans = 1;
  for (int i = 2; i < 100002 + 1; i++) {
    if (vis[i] == 0) continue;
    int lo = 1, hi = i;
    while (hi - lo > 1) {
      int mid = (lo + hi) / 2;
      if (query(mid, i, i))
        lo = mid;
      else
        hi = mid;
    }
    ans = max(ans, 1LL * lo * i);
  }
  cout << ans << '\n';
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  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;
int n, vis[100005];
vector<int> d[100005], a[100005], p[100005];
void pre() {
  for (int i = 1; i < 100002 + 1; i++) {
    for (int j = i; j <= 100002; j += i) {
      d[j].push_back(i);
    }
  }
  for (int i = 2; i < 100002 + 1; i++) {
    if ((int)p[i].size()) continue;
    for (int j = i; j <= 100002; j += i) {
      p[j].push_back(i);
    }
  }
}
int query(int l, int r, int w) {
  int cur = 0;
  for (int i = 0; i < 1 << (int)p[w].size(); i++) {
    int g = 1;
    for (int j = 0; j < (int)p[w].size(); j++) {
      if ((i >> j) & 1) g *= p[w][j];
    }
    int second = upper_bound((a[g]).begin(), (a[g]).end(), r) -
                 lower_bound((a[g]).begin(), (a[g]).end(), l);
    if (__builtin_popcount(i) % 2)
      cur -= second;
    else
      cur += second;
  }
  return cur;
}
void solve() {
  pre();
  cin >> n;
  for (int i = 0; i < n; i++) {
    int first;
    cin >> first;
    if (vis[first]) continue;
    for (auto j : d[first]) vis[j] = 1;
  }
  for (int i = 1; i < 100002 + 1; i++) {
    if (vis[i] == 0) continue;
    for (auto j : d[i]) a[j].push_back(i);
  }
  long long ans = 1;
  for (int i = 2; i < 100002 + 1; i++) {
    if (vis[i] == 0) continue;
    int lo = 1, hi = i;
    while (hi - lo > 1) {
      int mid = (lo + hi) / 2;
      if (query(mid, i, i))
        lo = mid;
      else
        hi = mid;
    }
    ans = max(ans, 1LL * lo * i);
  }
  cout << ans << '\n';
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}

```