#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,popcnt,tune=native")
#pragma GCC target("avx,avx2")
using namespace std;
long long bp(long long a, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) res *= a;
    a *= a;
    n >>= 1;
  }
  return res;
}
long long gcd(long long a, long long b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> a(n);
  vector<bool> u(200010);
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long res = 1;
  long long m = a[0];
  while (m > 1) {
    for (long long i = 2; i <= m; i++) {
      long long e = 0;
      while (m % i == 0) {
        e++;
        m /= i;
      }
      if (e > 0) {
        vector<long long> all;
        all.push_back(e);
        for (long long j = 1; j < n; j++) {
          long long q = a[j], er = 0;
          while (q % i == 0) {
            er++;
            q /= i;
          }
          all.push_back(er);
        }
        sort(all.begin(), all.end());
        if (all[1] != 0) u[i] = true;
        res *= bp(i, all[1]);
      }
    }
  }
  m = a[1];
  while (m > 1) {
    for (long long i = 2; i <= m; i++) {
      long long e = 0;
      while (m % i == 0) {
        e++;
        m /= i;
      }
      if (e > 0) {
        if (u[i]) continue;
        vector<long long> all;
        all.push_back(e);
        for (long long j = 0; j < n; j++) {
          if (j == 1) continue;
          long long q = a[j], er = 0;
          while (q % i == 0) {
            er++;
            q /= i;
          }
          all.push_back(er);
        }
        sort(all.begin(), all.end());
        res *= bp(i, all[1]);
      }
    }
  }
  cout << res;
  return 0;
}
