#include<iostream>
#include<algorithm>

using namespace std;

int a,b;

void search(int t)
{
	int r;
	
	if(r==0)
		return;
	
	if(t==1)
	{
		r=a%b;
		a=r;
		search(t=0);
	}
	else
	{
		r=b%a;
		b=r;
		search(t=1);
	}
	
}
int main()
{
	int a2,b2;
	
	for(;cin >> a;)
	{
		cin >> b;
		a2=a;
		b2=b;
		
		a=max(a2,b2);
		b=min(a2,b2);
		
		search(1);
		
		a=max(a,b);
		
		cout << a << " " << a2*(b2/a) << endl;
	}
}