#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0;
  bool f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = 0;
  for (; isdigit(c); c = getchar()) x = (x << 3) + (x << 1) + c - '0';
  if (f) return x;
  return 0 - x;
}
const int maxn = 110000 + 10;
int pri[maxn], vis[maxn], mu[maxn], cnt = 0;
vector<int> g[maxn];
void init() {
  vis[1] = mu[1] = 1;
  for (int i = 2; i < maxn; i++) {
    if (!vis[i]) {
      pri[++cnt] = i;
      mu[i] = -1;
    }
    for (int j = 1; j <= cnt && i * pri[j] < maxn; j++) {
      vis[i * pri[j]] = 1;
      if (i % pri[j] == 0) break;
      mu[i * pri[j]] = -mu[i];
    }
  }
  for (int i = 1; i < maxn; i++) {
    for (int j = i; j < maxn; j += i) {
      g[j].push_back(i);
    }
  }
}
int n, a[maxn], mp[maxn], sum[maxn];
int Mobius(int x) {
  int ret = 0;
  for (auto i : g[x]) ret += mu[i] * sum[i];
  return ret;
}
void modify(int x, int val) {
  for (auto i : g[x]) sum[i] += val;
}
int main() {
  init();
  n = read();
  int mx = 0;
  for (int i = 1; i <= n; i++) {
    a[i] = read();
    mp[a[i]] = 1;
    mx = max(mx, a[i]);
  }
  long long ans = 0;
  for (int d = 1; d <= mx; d++) {
    stack<int> s;
    for (int i = mx / d; i >= 1; i--) {
      if (!mp[i * d]) continue;
      while (Mobius(i)) {
        ans = max(ans, 1ll * d * s.top() * i);
        modify(s.top(), -1);
        s.pop();
      }
      modify(i, 1);
      s.push(i);
    }
    while (!s.empty()) {
      modify(s.top(), -1);
      s.pop();
    }
  }
  if (ans == 0) ans = mx;
  cout << ans << endl;
  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;
inline int read() {
  int x = 0;
  bool f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = 0;
  for (; isdigit(c); c = getchar()) x = (x << 3) + (x << 1) + c - '0';
  if (f) return x;
  return 0 - x;
}
const int maxn = 110000 + 10;
int pri[maxn], vis[maxn], mu[maxn], cnt = 0;
vector<int> g[maxn];
void init() {
  vis[1] = mu[1] = 1;
  for (int i = 2; i < maxn; i++) {
    if (!vis[i]) {
      pri[++cnt] = i;
      mu[i] = -1;
    }
    for (int j = 1; j <= cnt && i * pri[j] < maxn; j++) {
      vis[i * pri[j]] = 1;
      if (i % pri[j] == 0) break;
      mu[i * pri[j]] = -mu[i];
    }
  }
  for (int i = 1; i < maxn; i++) {
    for (int j = i; j < maxn; j += i) {
      g[j].push_back(i);
    }
  }
}
int n, a[maxn], mp[maxn], sum[maxn];
int Mobius(int x) {
  int ret = 0;
  for (auto i : g[x]) ret += mu[i] * sum[i];
  return ret;
}
void modify(int x, int val) {
  for (auto i : g[x]) sum[i] += val;
}
int main() {
  init();
  n = read();
  int mx = 0;
  for (int i = 1; i <= n; i++) {
    a[i] = read();
    mp[a[i]] = 1;
    mx = max(mx, a[i]);
  }
  long long ans = 0;
  for (int d = 1; d <= mx; d++) {
    stack<int> s;
    for (int i = mx / d; i >= 1; i--) {
      if (!mp[i * d]) continue;
      while (Mobius(i)) {
        ans = max(ans, 1ll * d * s.top() * i);
        modify(s.top(), -1);
        s.pop();
      }
      modify(i, 1);
      s.push(i);
    }
    while (!s.empty()) {
      modify(s.top(), -1);
      s.pop();
    }
  }
  if (ans == 0) ans = mx;
  cout << ans << endl;
  return 0;
}

```