#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, mark[N], m, u[N], cnt[N];
long long ans;
bool v[N];
vector<int> d[N], p;
int sum(int x) {
  int res = 0;
  for (int i = 0; i < d[x].size(); i++) res += cnt[d[x][i]] * u[d[x][i]];
  return res;
}
void add(int x, int y) {
  for (int i = 0; i < d[x].size(); i++) cnt[d[x][i]] += y;
}
int gcd(int x, int y) { return y == 0 ? x : gcd(y, x % y); }
void Mobius(int n) {
  u[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (v[i] == 0) {
      p.push_back(i);
      u[i] = -1;
    }
    for (int j = 0; i * p[j] <= n; j++) {
      int t = i * p[j];
      v[t] = 1;
      if (i % p[j] == 0) {
        u[t] = 0;
        break;
      }
      u[t] = -u[i];
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    mark[x] = 1;
    m = max(m, x);
  }
  ans = m;
  for (int i = 1; i <= m; i++)
    for (int j = i; j <= m; j += i) d[j].push_back(i);
  Mobius(m);
  for (int r = 1; r <= m; r++) {
    stack<int> s;
    for (int x = m / r; x > 0; x--) {
      if (!mark[x * r]) continue;
      int c = sum(x);
      while (c) {
        if (gcd(x, s.top()) == 1) {
          ans = max(ans, (long long)x * s.top() * r);
          c--;
        }
        add(s.top(), -1);
        s.pop();
      }
      s.push(x);
      add(x, 1);
    }
    while (s.size()) {
      add(s.top(), -1);
      s.pop();
    }
  }
  printf("%lld", ans);
  return 0;
}

### Prompt

Your task is to create 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 = 100005;
int n, mark[N], m, u[N], cnt[N];
long long ans;
bool v[N];
vector<int> d[N], p;
int sum(int x) {
  int res = 0;
  for (int i = 0; i < d[x].size(); i++) res += cnt[d[x][i]] * u[d[x][i]];
  return res;
}
void add(int x, int y) {
  for (int i = 0; i < d[x].size(); i++) cnt[d[x][i]] += y;
}
int gcd(int x, int y) { return y == 0 ? x : gcd(y, x % y); }
void Mobius(int n) {
  u[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (v[i] == 0) {
      p.push_back(i);
      u[i] = -1;
    }
    for (int j = 0; i * p[j] <= n; j++) {
      int t = i * p[j];
      v[t] = 1;
      if (i % p[j] == 0) {
        u[t] = 0;
        break;
      }
      u[t] = -u[i];
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    mark[x] = 1;
    m = max(m, x);
  }
  ans = m;
  for (int i = 1; i <= m; i++)
    for (int j = i; j <= m; j += i) d[j].push_back(i);
  Mobius(m);
  for (int r = 1; r <= m; r++) {
    stack<int> s;
    for (int x = m / r; x > 0; x--) {
      if (!mark[x * r]) continue;
      int c = sum(x);
      while (c) {
        if (gcd(x, s.top()) == 1) {
          ans = max(ans, (long long)x * s.top() * r);
          c--;
        }
        add(s.top(), -1);
        s.pop();
      }
      s.push(x);
      add(x, 1);
    }
    while (s.size()) {
      add(s.top(), -1);
      s.pop();
    }
  }
  printf("%lld", ans);
  return 0;
}

```