#include <bits/stdc++.h>
using namespace std;
const int __SIZE = 1 << 18;
char ibuf[__SIZE], *iS, *iT;
template <typename T>
inline void read(T &x) {
  char ch, t = 0;
  x = 0;
  while (!isdigit(ch = (iS == iT
                            ? (iT = (iS = ibuf) + fread(ibuf, 1, __SIZE, stdin),
                               (iS == iT ? EOF : *iS++))
                            : *iS++)))
    t |= ch == '-';
  while (isdigit(ch))
    x = x * 10 + (ch ^ 48),
    ch = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, __SIZE, stdin),
                      (iS == iT ? EOF : *iS++))
                   : *iS++);
  x = t ? -x : x;
}
inline int read_int() {
  int x;
  return read(x), x;
}
inline long long read_ll() {
  long long x;
  return read(x), x;
}
template <typename T>
inline void chkmin(T &a, T b) {
  a = a < b ? a : b;
}
template <typename T>
inline void chkmax(T &a, T b) {
  a = a > b ? a : b;
}
const int MAXN = 100010;
inline int gcd(int x, int y) { return !y ? x : gcd(y, x % y); }
long long res;
int tot;
int pri[MAXN];
int chk[MAXN];
int miu[MAXN];
vector<int> d[MAXN];
int a[MAXN];
int c[MAXN];
int v[MAXN];
inline void Sieve(int n) {
  miu[1] = 1;
  for (int i = 1; i <= n; i++) d[i].push_back(1);
  for (int i = 2; i <= n; i++) {
    if (!chk[i]) miu[i] = -1, pri[++tot] = i;
    for (int j = 1; j <= tot; j++) {
      if (i * pri[j] > n) break;
      chk[i * pri[j]] = 1;
      if (i % pri[j] == 0) break;
      miu[i * pri[j]] = -miu[i];
    }
    if (miu[i])
      for (int j = i; j <= n; j += i) d[j].push_back(i);
  }
}
int sta[MAXN];
int top;
inline long long Calc(int v) {
  int cnt = 0;
  for (auto D : d[v]) cnt += c[D];
  return cnt;
}
inline void Pop(int v) {
  chkmax(res, 1LL * v / gcd(v, sta[top]) * sta[top]);
  v = sta[top--];
  for (auto D : d[v]) c[D] -= miu[D];
}
inline void Push(int v) {
  sta[++top] = v;
  for (auto D : d[v]) c[D] += miu[D];
}
int main() {
  int n = read_int(), mx = 0, N = 0;
  v[++N] = 1;
  for (int i = 1; i <= n; i++) c[a[i] = read_int()]++, chkmax(mx, a[i]);
  Sieve(mx);
  for (int i = 2; i <= mx; i++)
    for (int j = i; j <= mx; j += i)
      if (c[j]) {
        v[++N] = j;
        break;
      }
  for (int i = 1; i <= mx; i++) {
    if (c[i] > 1) res = i;
    c[i] = 0;
  }
  for (int i = N; i >= 1; i--) {
    while (top && Calc(v[i])) Pop(v[i]);
    if (top) chkmax(res, 1LL * v[i] / gcd(v[i], sta[top]) * sta[top]);
    Push(v[i]);
  }
  cout << res << endl;
  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 __SIZE = 1 << 18;
char ibuf[__SIZE], *iS, *iT;
template <typename T>
inline void read(T &x) {
  char ch, t = 0;
  x = 0;
  while (!isdigit(ch = (iS == iT
                            ? (iT = (iS = ibuf) + fread(ibuf, 1, __SIZE, stdin),
                               (iS == iT ? EOF : *iS++))
                            : *iS++)))
    t |= ch == '-';
  while (isdigit(ch))
    x = x * 10 + (ch ^ 48),
    ch = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, __SIZE, stdin),
                      (iS == iT ? EOF : *iS++))
                   : *iS++);
  x = t ? -x : x;
}
inline int read_int() {
  int x;
  return read(x), x;
}
inline long long read_ll() {
  long long x;
  return read(x), x;
}
template <typename T>
inline void chkmin(T &a, T b) {
  a = a < b ? a : b;
}
template <typename T>
inline void chkmax(T &a, T b) {
  a = a > b ? a : b;
}
const int MAXN = 100010;
inline int gcd(int x, int y) { return !y ? x : gcd(y, x % y); }
long long res;
int tot;
int pri[MAXN];
int chk[MAXN];
int miu[MAXN];
vector<int> d[MAXN];
int a[MAXN];
int c[MAXN];
int v[MAXN];
inline void Sieve(int n) {
  miu[1] = 1;
  for (int i = 1; i <= n; i++) d[i].push_back(1);
  for (int i = 2; i <= n; i++) {
    if (!chk[i]) miu[i] = -1, pri[++tot] = i;
    for (int j = 1; j <= tot; j++) {
      if (i * pri[j] > n) break;
      chk[i * pri[j]] = 1;
      if (i % pri[j] == 0) break;
      miu[i * pri[j]] = -miu[i];
    }
    if (miu[i])
      for (int j = i; j <= n; j += i) d[j].push_back(i);
  }
}
int sta[MAXN];
int top;
inline long long Calc(int v) {
  int cnt = 0;
  for (auto D : d[v]) cnt += c[D];
  return cnt;
}
inline void Pop(int v) {
  chkmax(res, 1LL * v / gcd(v, sta[top]) * sta[top]);
  v = sta[top--];
  for (auto D : d[v]) c[D] -= miu[D];
}
inline void Push(int v) {
  sta[++top] = v;
  for (auto D : d[v]) c[D] += miu[D];
}
int main() {
  int n = read_int(), mx = 0, N = 0;
  v[++N] = 1;
  for (int i = 1; i <= n; i++) c[a[i] = read_int()]++, chkmax(mx, a[i]);
  Sieve(mx);
  for (int i = 2; i <= mx; i++)
    for (int j = i; j <= mx; j += i)
      if (c[j]) {
        v[++N] = j;
        break;
      }
  for (int i = 1; i <= mx; i++) {
    if (c[i] > 1) res = i;
    c[i] = 0;
  }
  for (int i = N; i >= 1; i--) {
    while (top && Calc(v[i])) Pop(v[i]);
    if (top) chkmax(res, 1LL * v[i] / gcd(v[i], sta[top]) * sta[top]);
    Push(v[i]);
  }
  cout << res << endl;
  return 0;
}

```