#include<iostream>
#include<algorithm>
using namespace std;
 
int main(){
long long   a,b,ta,tb;
     
    while(cin>>a>>b){
    ta=a;tb=b;
    if(a<b)swap(a,b);
    while(true){
       long long tmp=a;
        a=b;
        b=tmp-b;
        if(a-b==0)break;
    }
    cout<<b<<" "<<ta*tb/b<<endl;
    }
    return 0;
}