#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  return x * f;
}
int n, m, c[100010], a[100010], mu[100010];
long long ans;
vector<int> fac[100010];
long long Solve(int n) {
  long long ans = 0;
  static int t[100010];
  for (int i = 1; i <= n; ++i) t[i] = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = i; j <= n; j += i) t[i] += a[j];
  }
  for (int r = n, l = 1; l <= r; --r) {
    if (!a[r]) continue;
    static int h[100010];
    int tot = 0;
    for (auto k : fac[r]) {
      tot += t[k] * mu[k];
      h[k] = mu[k];
    }
    while (tot && l <= r) {
      if (!a[l]) {
        ++l;
        continue;
      }
      ans = max(ans, 1LL * l * r);
      for (auto i : fac[l]) --t[i], tot -= h[i];
      ++l;
    }
    for (auto k : fac[r]) h[k] = 0, --t[k];
  }
  return ans;
}
int main() {
  n = read();
  for (int i = 1; i <= n; ++i) {
    int x = read();
    ans = max(ans, 1LL * x);
    c[x] = 1;
    m = max(m, x);
  }
  for (int i = 1; i <= m; ++i) {
    for (int j = i; j <= m; j += i) {
      fac[j].push_back(i);
    }
  }
  mu[1] = 1;
  for (int i = 1; i <= m; ++i) {
    for (int j = i + i; j <= m; j += i) mu[j] -= mu[i];
  }
  for (int d = 1; d <= m; ++d) {
    for (int i = 1; i <= m / d; ++i) a[i] = c[i * d];
    ans = max(ans, Solve(m / d) * d);
  }
  printf("%lld\n", ans);
  return 0;
}

### Prompt

Your challenge is to write 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 long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  return x * f;
}
int n, m, c[100010], a[100010], mu[100010];
long long ans;
vector<int> fac[100010];
long long Solve(int n) {
  long long ans = 0;
  static int t[100010];
  for (int i = 1; i <= n; ++i) t[i] = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = i; j <= n; j += i) t[i] += a[j];
  }
  for (int r = n, l = 1; l <= r; --r) {
    if (!a[r]) continue;
    static int h[100010];
    int tot = 0;
    for (auto k : fac[r]) {
      tot += t[k] * mu[k];
      h[k] = mu[k];
    }
    while (tot && l <= r) {
      if (!a[l]) {
        ++l;
        continue;
      }
      ans = max(ans, 1LL * l * r);
      for (auto i : fac[l]) --t[i], tot -= h[i];
      ++l;
    }
    for (auto k : fac[r]) h[k] = 0, --t[k];
  }
  return ans;
}
int main() {
  n = read();
  for (int i = 1; i <= n; ++i) {
    int x = read();
    ans = max(ans, 1LL * x);
    c[x] = 1;
    m = max(m, x);
  }
  for (int i = 1; i <= m; ++i) {
    for (int j = i; j <= m; j += i) {
      fac[j].push_back(i);
    }
  }
  mu[1] = 1;
  for (int i = 1; i <= m; ++i) {
    for (int j = i + i; j <= m; j += i) mu[j] -= mu[i];
  }
  for (int d = 1; d <= m; ++d) {
    for (int i = 1; i <= m / d; ++i) a[i] = c[i * d];
    ans = max(ans, Solve(m / d) * d);
  }
  printf("%lld\n", ans);
  return 0;
}

```