#include <fstream>
using namespace std;
long i,a[100000],b[100000];
ifstream f1("ucbc.inp");
ofstream f2("ucbc.out");
long uc(long a,long b)
{
	while (a != b)
	{
		if (a > b) a = a - b;
		else b = b - a;
	}
	return a;
}
long bc(long a,long b)
{
	long x = a,y = b;
	while (a != b)
	{
		if (a > b) a = a - b;
		else b = b - a;
	}
	return x*y/a;
}
int main()
{
    f1 >> i;
    for (long n = 0; n < i; n++) {f1 >> a[n]; b[n] = a[n];}
    for (long n = i-1; n >= 1; n--)
	{
		for (long m = 0; m < n; m++)
		{
			a[m] = uc(a[m],a[m+1]);
			b[m] = bc(b[m],b[m+1]);
		}
	}
	f2 << a[0] << endl << b[0];
    return 0;
}
