#include<iostream>
#include<algorithm>

using namespace std;

int a,b;

int search(int s_a,int s_b)
{
	if(s_b==0)
		return s_a;
	
	search(s_b,s_a%s_b);
	
}

int main()
{
	int a2,b2;
	
	for(;cin >> a;)
	{
		cin >> b;
		a2=a;
		b2=b;
		
		a=max(a2,b2);
		b=min(a2,b2);
		
		
		
		a=search(a,b);
		
		cout << a << " " << a2*(b2/a) << endl;
	}
}