#include <fstream>
#include <iostream>
using namespace std;
int ucln(int a, int b)
{
    while (b > 0)
    {
     int r = a%b;
     a = b;
     b = r;
    }
    return a;
}
int bcnn(int a, int b)
{
    return (a*b) / ucln(a,b);
}
int main()
{
    ifstream f1("UCBC.inp");
    ofstream f2("UCBC.out");
    int a[10];
    int n,uc,bc;
    f1>>n;
    for (int i = 0; i < n; i++)
    {
        f1>>a[i];
    }
    uc = ucln(a[0],a[1]);
    bc = bcnn(a[0],a[1]);
    for (int i = 2; i < n; i++)
    {
        uc = ucln(uc,a[i]);
        bc = bcnn(bc,a[i]);
    }
    f2<<uc<<endl;
    f2<<bc;
    return 0;
}
