#include <bits/stdc++.h>

using namespace std;

ifstream fi ("UCBC.INP");
ofstream fo ("UCBC.OUT");

int ucln(long long a, long long b){
  long long temp;
    while (b != 0)
    {
        temp = a % b;
        a = b;
        b = temp;
    }
    return a;
}

int main(){
  int n;
  fi>>n;
  long long a[n],b[n],i;
  for (i=0;i<n;i++){fi>>a[i];b[i]=a[i];}
  for (i=1;i<n;i++){
    b[i]=ucln(b[i],b[i-1]);
    a[i]=a[i]*a[i-1]/ucln(a[i],a[i-1]);
  }
  fo<<b[n-1]<<endl;
  fo<<a[n-1];
}
