#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007, LIM = 4294967295;
long long int n, m, a, b, c, d, q, k, tr, summ, ans, minx, maxx, mass[100000],
    mass1[100000], mass2[100000], mass3[100000];
string s;
set<long long int> r, g, bb, all;
set<long long int> myset;
vector<long long int> myvec;
vector<vector<long long int>> myvecvec;
queue<long long int> myq;
map<long long int, multiset<long long int>> mymap;
int compare(const void* a, const void* b) {
  return -((*(long long int*)a) - (*(long long int*)b));
};
long long int gcd(long long int a, long long int b) {
  while (b != 0) {
    long long int t = b;
    b = a % b;
    a = t;
  }
  return a;
}
long long int gcdex(long long int a, long long int b, long long int& x,
                    long long int& y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  long long int x1, y1;
  long long int d = gcdex(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
long long int NOK(long long int n1, long long int n2) {
  return n1 * n2 / gcd(n1, n2);
}
long long int bin_pow(long long int base, long long int p) {
  if (p == 1) {
    return base % MOD;
  }
  if (p == 0) {
    return 1;
  }
  if (p % 2 == 0) {
    long long int t = bin_pow(base, p / 2) % MOD;
    return t * t % MOD;
  } else {
    return bin_pow(base, p - 1) * base % MOD;
  }
}
long long int inverse_element(long long int x) { return bin_pow(x, MOD - 2); }
long long int divide(long long int a, long long int b) {
  return a * inverse_element(b) % MOD;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie();
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    cin >> tr;
    for (int i = 2; i <= pow(tr, 0.5); i++) {
      a = 0;
      while (tr % i == 0) {
        tr /= i;
        a++;
      }
      if (a > 0) {
        mymap[i].insert(a);
      }
    }
    if (tr > 1) mymap[tr].insert(1);
  }
  b = 1;
  for (auto i : mymap) {
    if (i.second.size() < n - 1) {
      continue;
    }
    auto x = i.second.begin();
    if (i.second.size() == n) {
      x++;
    }
    b *= pow((double)i.first, (double)*x);
  }
  cout << b;
  return 0;
}
