#include<iostream>
using namespace std;
int main()
{
    long long  Gcd(long long a,long long b);
    long long  Lcm(long long a,long long b);
    long long a,b;
    long long gcd,lcm;
    while(cin>>a>>b)
    {
        gcd=Gcd(a,b);
        lcm=Lcm(a,b);
        cout<<gcd<<" "<<lcm<<endl;
    }
    return 0;
}
long long Gcd(long long a,long long b)
{
    return b==0?a:Gcd(b,a%b);
}
long long Lcm(long long a,long long b)
{
    return (a*b)/(Gcd(a,b));
}

