#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 s,b,r;
    if(x>y)
    {
        b=x;
        s=y;
    }
    else
    {
        b=y;
        s=x;
    }
    r=b%s;
    while(r!=0)
    {
        b=s;
        s=r;
        r=b%s;
    }
    return s;


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

}