#include <bits/stdc++.h>
using namespace std;
int tn, p[100500 >> 2], mu[100500];
bool e[100500];
void sieve(int n) {
  mu[1] = e[1] = 1;
  for (int i = 1; i <= n; i++) {
    if (!e[i]) mu[p[++tn] = i] = -1;
    for (int j = 1; j <= tn && i * p[j] <= n; j++) {
      e[i * p[j]] = 1;
      if (i % p[j] == 0) break;
      mu[i * p[j]] = -mu[i];
    }
  }
}
int gcd(int a, int b) { return !b ? a : gcd(b, a % b); }
int n, m, o[100500], stk[100500], top, s[100500];
vector<int> d[100500];
long long ans;
void add(int x) {
  int fl = 0;
  for (int i = 0; i < d[x].size(); i++) fl += s[d[x][i]];
  while (fl) {
    if (gcd(x, stk[top]) == 1) {
      ans = max(ans, 1ll * stk[top] * x);
      fl--;
    }
    for (int i = 0; i < d[stk[top]].size(); i++)
      s[d[stk[top]][i]] -= mu[d[stk[top]][i]];
    top--;
  }
  for (int i = 0; i < d[x].size(); i++) s[d[x][i]] += mu[d[x][i]];
  stk[++top] = x;
}
int main() {
  scanf("%d", &n);
  for (int i = 1, x; i <= n; i++) {
    scanf("%d", &x);
    o[x]++;
    m = max(x, m);
  }
  sieve(m);
  for (int i = 1; i <= m; i++)
    for (int j = i; j <= m; j += i) {
      o[i] |= o[j];
      d[j].push_back(i);
    }
  for (int i = m; i; i--) {
    if (o[i]) add(i);
    if (o[i] > 1) ans = max(ans, (long long)i);
  }
  printf("%lld", ans);
  return 0;
}

### Prompt

Please create a solution in cpp 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 tn, p[100500 >> 2], mu[100500];
bool e[100500];
void sieve(int n) {
  mu[1] = e[1] = 1;
  for (int i = 1; i <= n; i++) {
    if (!e[i]) mu[p[++tn] = i] = -1;
    for (int j = 1; j <= tn && i * p[j] <= n; j++) {
      e[i * p[j]] = 1;
      if (i % p[j] == 0) break;
      mu[i * p[j]] = -mu[i];
    }
  }
}
int gcd(int a, int b) { return !b ? a : gcd(b, a % b); }
int n, m, o[100500], stk[100500], top, s[100500];
vector<int> d[100500];
long long ans;
void add(int x) {
  int fl = 0;
  for (int i = 0; i < d[x].size(); i++) fl += s[d[x][i]];
  while (fl) {
    if (gcd(x, stk[top]) == 1) {
      ans = max(ans, 1ll * stk[top] * x);
      fl--;
    }
    for (int i = 0; i < d[stk[top]].size(); i++)
      s[d[stk[top]][i]] -= mu[d[stk[top]][i]];
    top--;
  }
  for (int i = 0; i < d[x].size(); i++) s[d[x][i]] += mu[d[x][i]];
  stk[++top] = x;
}
int main() {
  scanf("%d", &n);
  for (int i = 1, x; i <= n; i++) {
    scanf("%d", &x);
    o[x]++;
    m = max(x, m);
  }
  sieve(m);
  for (int i = 1; i <= m; i++)
    for (int j = i; j <= m; j += i) {
      o[i] |= o[j];
      d[j].push_back(i);
    }
  for (int i = m; i; i--) {
    if (o[i]) add(i);
    if (o[i] > 1) ans = max(ans, (long long)i);
  }
  printf("%lld", ans);
  return 0;
}

```