#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, flag[N], mx, cntp, pri[N], mu[N], stk[N], top, cnt[N];
bool vis[N];
vector<int> d[N];
void prp(int n) {
  mu[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (!vis[i]) pri[++cntp] = i, mu[i] = -1;
    for (int j = 1; j <= cntp && pri[j] * i <= n; j++) {
      vis[pri[j] * i] = true;
      mu[pri[j] * i] = i % pri[j] ? -mu[i] : 0;
      if (i % pri[j] == 0) break;
    }
  }
}
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int a;
    scanf("%d", &a);
    flag[a] = 1;
    mx = max(mx, a);
  }
  prp(mx);
  for (int i = 1; i <= mx; i++)
    for (int j = i; j <= mx; j += i) d[j].push_back(i);
  long long ans = 0;
  for (int i = 1; i <= mx; i++) {
    for (int j = mx / i; j >= 1; j--)
      if (flag[j * i]) {
        int s = 0;
        for (int k = 0; k < (int)d[j].size(); k++)
          s += mu[d[j][k]] * cnt[d[j][k]];
        while (s) {
          int now = stk[top--];
          if (gcd(now, j) == 1) s--, ans = max(ans, 1ll * i * j * now);
          for (int k = 0; k < (int)d[now].size(); k++) cnt[d[now][k]]--;
        }
        stk[++top] = j;
        for (int k = 0; k < (int)d[j].size(); k++) cnt[d[j][k]]++;
      }
    while (top) {
      int now = stk[top--];
      for (int k = 0; k < (int)d[now].size(); k++) cnt[d[now][k]]--;
    }
  }
  printf("%lld", max(ans, (long long)mx));
  return 0;
}

### Prompt

Please formulate 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 + 5;
int n, flag[N], mx, cntp, pri[N], mu[N], stk[N], top, cnt[N];
bool vis[N];
vector<int> d[N];
void prp(int n) {
  mu[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (!vis[i]) pri[++cntp] = i, mu[i] = -1;
    for (int j = 1; j <= cntp && pri[j] * i <= n; j++) {
      vis[pri[j] * i] = true;
      mu[pri[j] * i] = i % pri[j] ? -mu[i] : 0;
      if (i % pri[j] == 0) break;
    }
  }
}
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int a;
    scanf("%d", &a);
    flag[a] = 1;
    mx = max(mx, a);
  }
  prp(mx);
  for (int i = 1; i <= mx; i++)
    for (int j = i; j <= mx; j += i) d[j].push_back(i);
  long long ans = 0;
  for (int i = 1; i <= mx; i++) {
    for (int j = mx / i; j >= 1; j--)
      if (flag[j * i]) {
        int s = 0;
        for (int k = 0; k < (int)d[j].size(); k++)
          s += mu[d[j][k]] * cnt[d[j][k]];
        while (s) {
          int now = stk[top--];
          if (gcd(now, j) == 1) s--, ans = max(ans, 1ll * i * j * now);
          for (int k = 0; k < (int)d[now].size(); k++) cnt[d[now][k]]--;
        }
        stk[++top] = j;
        for (int k = 0; k < (int)d[j].size(); k++) cnt[d[j][k]]++;
      }
    while (top) {
      int now = stk[top--];
      for (int k = 0; k < (int)d[now].size(); k++) cnt[d[now][k]]--;
    }
  }
  printf("%lld", max(ans, (long long)mx));
  return 0;
}

```