#include <bits/stdc++.h>
const int mod = 1000000007;
const int inf = 1000000009;
const long long INF = 1000000000000000009;
const long long big = 1000000000000000;
const long double eps = 0.000000000000000000001;
using namespace std;
const int M = 100000;
int W[M + 5], U[M + 5], cnt[M + 5];
vector<int> D[M + 5], S;
long long int funkcja(int x) {
  long long int wynik = 0;
  for (auto v : D[x]) wynik += cnt[v] * U[v];
  return wynik;
}
void aktualizuj(int x, int c) {
  for (auto v : D[x]) cnt[v] += c;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  int n;
  cin >> n;
  for (int i = 1; i <= M; i++) {
    for (int j = i; j <= M; j += i) D[j].push_back(i);
    if (i == 1)
      U[i] = 1;
    else if ((i / D[i][1]) % D[i][1] == 0)
      U[i] = 0;
    else
      U[i] = -U[i / D[i][1]];
  }
  long long int wynik = 0;
  for (int i = 1; i <= n; i++) {
    int a;
    cin >> a;
    wynik = max(wynik, (long long int)a);
    for (auto v : D[a]) W[v] = 1;
  }
  for (int j = M; j >= 1; j--) {
    if (!W[j]) continue;
    while (funkcja(j)) {
      wynik = max(wynik, (long long int)j * S.back());
      aktualizuj(S.back(), -1);
      S.pop_back();
    }
    aktualizuj(j, 1);
    S.push_back(j);
  }
  cout << wynik;
  return 0;
}

### Prompt

Please provide a Cpp coded solution to the problem described below:

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>
const int mod = 1000000007;
const int inf = 1000000009;
const long long INF = 1000000000000000009;
const long long big = 1000000000000000;
const long double eps = 0.000000000000000000001;
using namespace std;
const int M = 100000;
int W[M + 5], U[M + 5], cnt[M + 5];
vector<int> D[M + 5], S;
long long int funkcja(int x) {
  long long int wynik = 0;
  for (auto v : D[x]) wynik += cnt[v] * U[v];
  return wynik;
}
void aktualizuj(int x, int c) {
  for (auto v : D[x]) cnt[v] += c;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  int n;
  cin >> n;
  for (int i = 1; i <= M; i++) {
    for (int j = i; j <= M; j += i) D[j].push_back(i);
    if (i == 1)
      U[i] = 1;
    else if ((i / D[i][1]) % D[i][1] == 0)
      U[i] = 0;
    else
      U[i] = -U[i / D[i][1]];
  }
  long long int wynik = 0;
  for (int i = 1; i <= n; i++) {
    int a;
    cin >> a;
    wynik = max(wynik, (long long int)a);
    for (auto v : D[a]) W[v] = 1;
  }
  for (int j = M; j >= 1; j--) {
    if (!W[j]) continue;
    while (funkcja(j)) {
      wynik = max(wynik, (long long int)j * S.back());
      aktualizuj(S.back(), -1);
      S.pop_back();
    }
    aktualizuj(j, 1);
    S.push_back(j);
  }
  cout << wynik;
  return 0;
}

```