#include<iostream>
using namespace std;
int lcm(long long x,long long y);
int gcd(long long x,long long y);
int main()
{
    long long a,b;
    while(cin>>a>>b)
    {
        cout<<lcm(a,b)<<" "<<gcd(a,b)<<endl;
    }

    return 0;
}
int lcm(long long x,long long y)
{
    long long a,i;
    if(x>y) a=y;
    else a=x;
    for(i=a;i>0;i--)
    {
        if(x%i==0 && y%i==0)
        {
            return i;
            break;
        }
    }


}
int gcd(long long x,long long y)
{
    return ((x*y)/lcm(x,y));

}