#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int Mod(int x) { return x >= mod ? x - mod : x; }
long long read() {
  long long x = 0;
  int f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + (ch ^ 48);
  return x * f;
}
void print(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) print(x / 10);
  putchar(x % 10 + '0');
}
const int N = 100010;
int n;
long long ans;
int prime[N], tot, mu[N];
bool vis[N];
void init(int n) {
  mu[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (!vis[i]) mu[prime[++tot] = i] = -1;
    for (int j = 1, k; j <= tot && (k = i * prime[j]) <= n; j++) {
      vis[k] = 1;
      if (i % prime[j] == 0) {
        mu[k] = 0;
        break;
      }
      mu[k] = -mu[i];
    }
  }
}
vector<int> fac[N];
bool book[N];
int maxx;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int cnt[N];
stack<int> s;
int sum(int x) {
  int res = 0;
  for (int i : fac[x]) res += cnt[i] * mu[i];
  return res;
}
void add(int x, int y) {
  for (int i : fac[x]) cnt[i] += y;
}
int main() {
  n = read();
  for (int i = 1, x; i <= n; i++) book[x = read()] = 1, maxx = max(x, maxx);
  for (int i = 1; i <= maxx; i++)
    for (int j = i; j <= maxx; j += i) fac[j].push_back(i);
  ans = maxx, init(maxx);
  for (int r = 1; r <= maxx; r++) {
    for (int x = maxx / r; x; x--) {
      if (!book[x * r]) continue;
      int num = sum(x);
      while (num) {
        if (gcd(x, s.top()) == 1)
          ans = max(ans, (long long)x * s.top() * r), num--;
        add(s.top(), -1), s.pop();
      }
      s.push(x), add(x, 1);
    }
    while (!s.empty()) add(s.top(), -1), s.pop();
  }
  print(ans), putchar('\n');
  return 0;
}

### Prompt

Construct a CPP code solution to the problem outlined:

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 = 998244353;
int Mod(int x) { return x >= mod ? x - mod : x; }
long long read() {
  long long x = 0;
  int f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + (ch ^ 48);
  return x * f;
}
void print(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) print(x / 10);
  putchar(x % 10 + '0');
}
const int N = 100010;
int n;
long long ans;
int prime[N], tot, mu[N];
bool vis[N];
void init(int n) {
  mu[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (!vis[i]) mu[prime[++tot] = i] = -1;
    for (int j = 1, k; j <= tot && (k = i * prime[j]) <= n; j++) {
      vis[k] = 1;
      if (i % prime[j] == 0) {
        mu[k] = 0;
        break;
      }
      mu[k] = -mu[i];
    }
  }
}
vector<int> fac[N];
bool book[N];
int maxx;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int cnt[N];
stack<int> s;
int sum(int x) {
  int res = 0;
  for (int i : fac[x]) res += cnt[i] * mu[i];
  return res;
}
void add(int x, int y) {
  for (int i : fac[x]) cnt[i] += y;
}
int main() {
  n = read();
  for (int i = 1, x; i <= n; i++) book[x = read()] = 1, maxx = max(x, maxx);
  for (int i = 1; i <= maxx; i++)
    for (int j = i; j <= maxx; j += i) fac[j].push_back(i);
  ans = maxx, init(maxx);
  for (int r = 1; r <= maxx; r++) {
    for (int x = maxx / r; x; x--) {
      if (!book[x * r]) continue;
      int num = sum(x);
      while (num) {
        if (gcd(x, s.top()) == 1)
          ans = max(ans, (long long)x * s.top() * r), num--;
        add(s.top(), -1), s.pop();
      }
      s.push(x), add(x, 1);
    }
    while (!s.empty()) add(s.top(), -1), s.pop();
  }
  print(ans), putchar('\n');
  return 0;
}

```