
#include<iostream>
#include <xiosbase>
using namespace std;
long long gcd(long long a,long long b)
{
    if(b==0) return a;
    else return gcd(b,a%b);
}
long long kmm(long long a,long long b)
{
    return a*b/gcd(a,b);
}
int main()
{
	system("CLS");
    long long a,b;
    cin>>a>>b;
	while(!cin.eof())
	{
	cout<<gcd(a,b);
	cout<<" ";
	cout<<kmm(a,b);
	cout<<endl;
	cin>>a>>b;

	}
    return 0;
}