#include <iostream>
using namespace std;

int gcm_sub(int c,int d)
	{
		if (c % d == 0)
			return d;
		else
			return gcm_sub(d,c % d);
	}
int gcm(int a,int b)
{
	if (a >= b) 
		return gcm_sub(a,b);
	else if (b > a)
		return gcm_sub(b,a);
}

int lcm(int a,int b)
{
	return (a*b) / gcm(a,b);
}

int main()
{
	int a[2];
	int i=0;
	int n;
	while(cin >> n){
		// cout << sizeof(a) / sizeof(a[0]) << endl;
		if (i==sizeof(a) / sizeof(a[0]) - 1){
			a[i] = n;
			// cout << "start" << endl;
			// cout << "a[0]=" << a[0] << "a[1]=" << a[1] << endl;
			cout << gcm(a[0],a[1]) << ' ' << lcm(a[0],a[1]) << endl;
			i = 0;
		}
		else {
			a[i] = n;
			i++ ;
		}
	}
	
	return 0;
}