#include <iostream>
using namespace std;

long gcd(long  a,long b){
    if(b>a){long t=a;a=b;b=t;}
    while(true){
        if(a%b==0){return b;}
        else{a=a%b;}
        if(b%a==0){return a;}
        else{b=b%a;}
        }
}

long lcm(long a,long b){
    return a*b/gcd(a,b);
}

int main (int argc, const char * argv[])
{
    int x,y;
    while(cin>>x>>y){
    cout<<gcd(x,y)<<' '<<lcm(x,y)<<endl;
    }
    return 0;
}