#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, cnt[maxn];
bool b[maxn], vis[maxn];
vector<int> d[maxn];
long long ans;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int mu[maxn], primes[maxn], tot;
void get_mu(int n) {
  mu[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (!vis[i]) {
      primes[++tot] = i;
      mu[i] = -1;
    }
    for (int j = 1; primes[j] <= n / i; j++) {
      vis[primes[j] * i] = 1;
      if (i % primes[j] == 0)
        break;
      else
        mu[i * primes[j]] = -mu[i];
    }
  }
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j += i) d[j].push_back(i);
}
long long coprime(long long x) {
  long long res = 0;
  for (int i = 0; i < d[x].size(); i++) res += cnt[d[x][i]] * mu[d[x][i]];
  return res;
}
void update(int x, int a) {
  for (int i = 0; i < d[x].size(); i++) cnt[d[x][i]] += a;
}
int main() {
  get_mu(maxn - 10);
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    long long x;
    scanf("%lld", &x);
    ans = max(ans, x);
    b[x] = 1;
  }
  stack<int> s;
  for (int g = 1; g <= maxn - 10; g++) {
    for (int i = (maxn - 10) / g; i > 0; i--) {
      if (!b[i * g]) continue;
      int c = coprime(i);
      while (c) {
        if (gcd(s.top(), i) == 1) {
          ans = max(ans, 1ll * i * s.top() * g);
          c--;
        }
        update(s.top(), -1);
        s.pop();
      }
      update(i, 1);
      s.push(i);
    }
    while (s.size()) {
      update(s.top(), -1);
      s.pop();
    }
  }
  cout << ans << endl;
  return 0;
}

### 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 maxn = 1e5 + 10;
int n, cnt[maxn];
bool b[maxn], vis[maxn];
vector<int> d[maxn];
long long ans;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int mu[maxn], primes[maxn], tot;
void get_mu(int n) {
  mu[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (!vis[i]) {
      primes[++tot] = i;
      mu[i] = -1;
    }
    for (int j = 1; primes[j] <= n / i; j++) {
      vis[primes[j] * i] = 1;
      if (i % primes[j] == 0)
        break;
      else
        mu[i * primes[j]] = -mu[i];
    }
  }
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j += i) d[j].push_back(i);
}
long long coprime(long long x) {
  long long res = 0;
  for (int i = 0; i < d[x].size(); i++) res += cnt[d[x][i]] * mu[d[x][i]];
  return res;
}
void update(int x, int a) {
  for (int i = 0; i < d[x].size(); i++) cnt[d[x][i]] += a;
}
int main() {
  get_mu(maxn - 10);
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    long long x;
    scanf("%lld", &x);
    ans = max(ans, x);
    b[x] = 1;
  }
  stack<int> s;
  for (int g = 1; g <= maxn - 10; g++) {
    for (int i = (maxn - 10) / g; i > 0; i--) {
      if (!b[i * g]) continue;
      int c = coprime(i);
      while (c) {
        if (gcd(s.top(), i) == 1) {
          ans = max(ans, 1ll * i * s.top() * g);
          c--;
        }
        update(s.top(), -1);
        s.pop();
      }
      update(i, 1);
      s.push(i);
    }
    while (s.size()) {
      update(s.top(), -1);
      s.pop();
    }
  }
  cout << ans << endl;
  return 0;
}

```