#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
	long long a,b,c,a1,b1,p,min,max;
	while(cin>>a>>b)
	{
		if(a<b){p=a;a=b;b=p;}
		a1=a;b1=b;
		while(a%b!=0)
		{
           c=a%b;
           a=b;
           b=c;
       }
		min=b;
		max=a1*b1/min;
		cout<<min<<" "<<max<<endl;
	}
	return 0;
}