#include <iostream>
#include <algorithm>
using namespace std;
long long solve(long long a,long long b){
    int w,max=a,min=b;
    if(a<b){
        max=b;
        min=a;
    }
    while(max%min!=0){
        max-=min;
        if(max<min){
          w=min;
          min=max;
          max=w;
        }
    }
    return min;
}
int main(void){
    long long a,b;
    while(cin>>a>>b){
        cout<<solve(a,b)<<" "<<a*b/solve(a,b)<<endl;
    }
    return 0;
}