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