#include <iostream>
using namespace std;
int main(){
    int a,b,lcm=0,r,x,y;
    while(cin>>a>>b){
        x=a;
        y=b;
        while(1){
        r=a%b;
        a=b;
        b=r;
        if(r==0)break;
        }
        lcm=a;
    cout<<lcm<<" "<<x*y/lcm<<endl;
}
}