#include <iostream>
#include <vector>
using namespace std;

int gcd(int a,int b)
{
    int l,s,r;
    if (a<b)
    {
	l=b;
	s=a;
    } else {
	l=a;
	s=b;
    }
    while(true)
    {
	r=l%s;
	if (r == 0) break;
	l=s;
	s=r;
    }
    return s;
}

int main()
{
    int a,b;
    vector<int> r1,r2;
    while (scanf("%d %d",&a,&b) != EOF)
    {
	r1.push_back(gcd(a,b));
	r2.push_back(a/r1[r1.size()-1]*b);
    }
    for (int i=0; i<r1.size(); i++)
    {
	cout << r1[i] << " " << r2[i] << endl;
    }
}