#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b){
    
    if (a == 0 || b == 0){
        return a + b;
    }
    while (a != b){
        if (a > b){
            a -= b; 
        }else{
            b -= a;
        }
    }
    return a; 
}
int bcnn(int a, int b){
	a=a*b/gcd(a,b);
	return a;
}
int main ()
{
	freopen ("UCBC.inp", "r ", stdin);
	freopen ("UCBC.out", "w", stdout);
	int b,c,d,n;
	cin>>n;
	int a[n+1],e[n+1];
	for (int i=1; i<=n; i++)
	{cin >> a[i];
	e[i]=a[i];
	}
	for (int y=1; y<n; y++)
	{a[y+1]=gcd(a[y],a[y+1]);
	e[y+1]=bcnn(e[y],e[y+1]);
	}
	cout << a[n] << endl << e[n];
}
