#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
long long gcd(long long x, long long y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
long long ksm(long long a, long long b) {
  long long r = 1;
  while (b) {
    if (b & 1) r = (r * a) % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return r;
}
void exgcd(long long a, long long b, long long& d, long long& x, long long& y) {
  if (!b) {
    d = a;
    x = 1;
    y = 0;
  } else {
    exgcd(b, a % b, d, y, x);
    y -= x * (a / b);
  }
}
long long inv(long long a, long long p) {
  long long d, x, y;
  exgcd(a, p, d, x, y);
  return d == 1 ? (x + p) % p : -1;
}
inline int read() {
  char c = getchar();
  int x = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
const int maxn = 1e5 + 100;
int n, m, k, t, v[maxn];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    v[x]++;
  }
  for (int i = 1; i <= n; i++) {
    if (!v[i]) continue;
    for (int j = i * 2; j < maxn; j += i) {
      if (v[j]) {
        v[i] = 0;
        break;
      }
    }
  }
  vector<int> g;
  for (int i = 1; i < maxn; i++)
    if (v[i]) g.push_back(i);
  reverse(g.begin(), g.end());
  long long ans = 0;
  if (g.size() > 1)
    for (int i = 0; i < g.size(); i++) {
      int l = 1e9;
      for (int j = i + 1; j < g.size(); j++) {
        long long pro = 1ll * g[i] * g[j];
        if (ans >= pro) break;
        if (g[j] % l == 0) continue;
        int tmp = gcd(g[i], g[j]);
        if (l <= tmp) continue;
        l = tmp;
        ans = max(ans, pro / l);
      }
    }
  else
    ans = g[0];
  cout << ans << endl;
}

### 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 mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
long long gcd(long long x, long long y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
long long ksm(long long a, long long b) {
  long long r = 1;
  while (b) {
    if (b & 1) r = (r * a) % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return r;
}
void exgcd(long long a, long long b, long long& d, long long& x, long long& y) {
  if (!b) {
    d = a;
    x = 1;
    y = 0;
  } else {
    exgcd(b, a % b, d, y, x);
    y -= x * (a / b);
  }
}
long long inv(long long a, long long p) {
  long long d, x, y;
  exgcd(a, p, d, x, y);
  return d == 1 ? (x + p) % p : -1;
}
inline int read() {
  char c = getchar();
  int x = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
const int maxn = 1e5 + 100;
int n, m, k, t, v[maxn];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    v[x]++;
  }
  for (int i = 1; i <= n; i++) {
    if (!v[i]) continue;
    for (int j = i * 2; j < maxn; j += i) {
      if (v[j]) {
        v[i] = 0;
        break;
      }
    }
  }
  vector<int> g;
  for (int i = 1; i < maxn; i++)
    if (v[i]) g.push_back(i);
  reverse(g.begin(), g.end());
  long long ans = 0;
  if (g.size() > 1)
    for (int i = 0; i < g.size(); i++) {
      int l = 1e9;
      for (int j = i + 1; j < g.size(); j++) {
        long long pro = 1ll * g[i] * g[j];
        if (ans >= pro) break;
        if (g[j] % l == 0) continue;
        int tmp = gcd(g[i], g[j]);
        if (l <= tmp) continue;
        l = tmp;
        ans = max(ans, pro / l);
      }
    }
  else
    ans = g[0];
  cout << ans << endl;
}

```