#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
    long long a,b,c,d,e;
    cin>>a>>b;
    for(long long i=1;i<2000000000;i++){
        if(a%i==0 && b%i==0){
            c=i;
            break;
        }
    }
    e=a*b/c;
    cout<<c<<" "<<e<<endl;
    return 0;
}