#include <bits/stdc++.h>
using namespace std;
const long long MOD = (long long)1e9 + 7;
const long double PI = 3.141592653589793238462643383279502884197;
priority_queue<int, vector<int>, greater<int>> pq;
vector<int> v;
char check[100001];
char visit[100001];
int cnt[100001];
vector<int> stk;
vector<int> pr[100001];
void update(int now, int dd, vector<int> &dv, int val) {
  cnt[now] += val;
  for (int i = dd; i < (int)(dv).size(); i++)
    update(now * dv[i], i + 1, dv, val);
}
int pnm(int now, int dd, vector<int> &dv) {
  int sum = cnt[now];
  for (int i = dd; i < (int)(dv).size(); i++)
    sum -= pnm(now * dv[i], i + 1, dv);
  return sum;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
  int n;
  scanf("%d", &n);
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    int t;
    scanf("%d", &t);
    ans = max(ans, (long long)t);
    for (int j = 1; j * j <= t; j++) {
      if (t % j == 0) check[j] = check[t / j] = 1;
    }
  }
  for (int i = 100000; i >= 1; i--) {
    if (check[i]) {
      int t = i;
      for (int j = 2; j * j <= t; j++) {
        int cnt = 0;
        while (t % j == 0) {
          t /= j;
          cnt++;
        }
        if (cnt) pr[i].push_back(j);
      }
      if (t > 1) pr[i].push_back(t);
      int c = pnm(1, 0, pr[i]);
      while (c) {
        if (gcd(i, stk.back()) == 1) {
          ans = max(ans, stk.back() * (long long)i);
          c--;
        }
        update(1, 0, pr[stk.back()], -1);
        stk.pop_back();
      }
      stk.push_back(i);
      update(1, 0, pr[i], 1);
    }
  }
  printf("%lld", ans);
}

### Prompt

Your challenge is to write 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 long long MOD = (long long)1e9 + 7;
const long double PI = 3.141592653589793238462643383279502884197;
priority_queue<int, vector<int>, greater<int>> pq;
vector<int> v;
char check[100001];
char visit[100001];
int cnt[100001];
vector<int> stk;
vector<int> pr[100001];
void update(int now, int dd, vector<int> &dv, int val) {
  cnt[now] += val;
  for (int i = dd; i < (int)(dv).size(); i++)
    update(now * dv[i], i + 1, dv, val);
}
int pnm(int now, int dd, vector<int> &dv) {
  int sum = cnt[now];
  for (int i = dd; i < (int)(dv).size(); i++)
    sum -= pnm(now * dv[i], i + 1, dv);
  return sum;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
  int n;
  scanf("%d", &n);
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    int t;
    scanf("%d", &t);
    ans = max(ans, (long long)t);
    for (int j = 1; j * j <= t; j++) {
      if (t % j == 0) check[j] = check[t / j] = 1;
    }
  }
  for (int i = 100000; i >= 1; i--) {
    if (check[i]) {
      int t = i;
      for (int j = 2; j * j <= t; j++) {
        int cnt = 0;
        while (t % j == 0) {
          t /= j;
          cnt++;
        }
        if (cnt) pr[i].push_back(j);
      }
      if (t > 1) pr[i].push_back(t);
      int c = pnm(1, 0, pr[i]);
      while (c) {
        if (gcd(i, stk.back()) == 1) {
          ans = max(ans, stk.back() * (long long)i);
          c--;
        }
        update(1, 0, pr[stk.back()], -1);
        stk.pop_back();
      }
      stk.push_back(i);
      update(1, 0, pr[i], 1);
    }
  }
  printf("%lld", ans);
}

```