#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int mod = 1e9 + 7;
vector<int> d[N];
int prime[N], notprime[N], mu[N], cnt;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
void init() {
  for (int i = 1; i < N; i++)
    for (int j = 1; j * j <= i; j++)
      if (i % j == 0) {
        d[i].push_back(j);
        if (j * j != i) d[i].push_back(i / j);
      }
  mu[1] = 1;
  for (int i = 2; i < N; i++) {
    if (!notprime[i]) {
      prime[++cnt] = i;
      mu[i] = -1;
    }
    for (int j = 1; j <= cnt && i * prime[j] < N; j++) {
      notprime[i * prime[j]] = 1;
      if (i % prime[j]) {
        mu[i * prime[j]] = mu[i] * (-1);
      } else {
        mu[i * prime[j]] = 0;
        break;
      }
    }
  }
}
bool cmp(int a, int b) { return a > b; }
long long ans;
int n, v[N], a[N], dd[N], b[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    v[a[i]]++;
  }
  sort(a + 1, a + 1 + n, cmp);
  for (int i = 1; i < N; i++)
    if (v[i] >= 2) ans = max(1ll * i, ans);
  init();
  for (int g = 1; g <= sqrt(N); g++) {
    stack<int> s;
    int num = 0;
    for (int i = 1; i <= n; i++)
      if (a[i] % g == 0) b[++num] = a[i] / g;
    if (num <= 1) continue;
    for (int i = 1; i <= num; i++) {
      int res = 0, x = b[i];
      for (int t = 0; t < d[x].size(); t++) res += dd[d[x][t]] * mu[d[x][t]];
      while (res > 0 && !s.empty()) {
        int y = s.top();
        s.pop();
        if (gcd(x, y) == 1) {
          ans = max(ans, 1ll * x * y * g);
          res--;
        }
        for (int t = 0; t < d[y].size(); t++) dd[d[y][t]]--;
      }
      s.push(x);
      for (int t = 0; t < d[x].size(); t++) dd[d[x][t]]++;
    }
    while (!s.empty()) {
      int y = s.top();
      s.pop();
      for (int t = 0; t < d[y].size(); t++) dd[d[y][t]]--;
    }
  }
  printf("%lld\n", ans);
}

### Prompt

Generate 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 N = 1e5 + 10;
const int mod = 1e9 + 7;
vector<int> d[N];
int prime[N], notprime[N], mu[N], cnt;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
void init() {
  for (int i = 1; i < N; i++)
    for (int j = 1; j * j <= i; j++)
      if (i % j == 0) {
        d[i].push_back(j);
        if (j * j != i) d[i].push_back(i / j);
      }
  mu[1] = 1;
  for (int i = 2; i < N; i++) {
    if (!notprime[i]) {
      prime[++cnt] = i;
      mu[i] = -1;
    }
    for (int j = 1; j <= cnt && i * prime[j] < N; j++) {
      notprime[i * prime[j]] = 1;
      if (i % prime[j]) {
        mu[i * prime[j]] = mu[i] * (-1);
      } else {
        mu[i * prime[j]] = 0;
        break;
      }
    }
  }
}
bool cmp(int a, int b) { return a > b; }
long long ans;
int n, v[N], a[N], dd[N], b[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    v[a[i]]++;
  }
  sort(a + 1, a + 1 + n, cmp);
  for (int i = 1; i < N; i++)
    if (v[i] >= 2) ans = max(1ll * i, ans);
  init();
  for (int g = 1; g <= sqrt(N); g++) {
    stack<int> s;
    int num = 0;
    for (int i = 1; i <= n; i++)
      if (a[i] % g == 0) b[++num] = a[i] / g;
    if (num <= 1) continue;
    for (int i = 1; i <= num; i++) {
      int res = 0, x = b[i];
      for (int t = 0; t < d[x].size(); t++) res += dd[d[x][t]] * mu[d[x][t]];
      while (res > 0 && !s.empty()) {
        int y = s.top();
        s.pop();
        if (gcd(x, y) == 1) {
          ans = max(ans, 1ll * x * y * g);
          res--;
        }
        for (int t = 0; t < d[y].size(); t++) dd[d[y][t]]--;
      }
      s.push(x);
      for (int t = 0; t < d[x].size(); t++) dd[d[x][t]]++;
    }
    while (!s.empty()) {
      int y = s.top();
      s.pop();
      for (int t = 0; t < d[y].size(); t++) dd[d[y][t]]--;
    }
  }
  printf("%lld\n", ans);
}

```