#include<iostream>
using namespace std;
typedef unsigned long long ull;
ull a,b;
ull gcd(ull x,ull y){
return y==0?x:gcd(y,x%y);
}
int main(){
    cin>>a>>b;
    ull temp=gcd(a,b);
    ull sum=a/temp*b;
    cout<<temp<<" "<<sum<<endl;
}

