#include <iostream>
using namespace std;

int main(){
	while(true)
	{
	long long int m,n;
	cin >> m;
	if(cin.eof()) break;
	cin >> n;
	long long int l1 = m, l2 = n;
	while(l1 != l2)
	{
		if(l1 > l2) l1-=l2;
		else l2-=l1;
	}
	long long int gcd = m*n/l1;
	cout << l1 << " " << gcd << endl;
	}
	return 0;
}