#include <iostream>

using namespace std;
int f(int a,int b){
     int n;
     n=a%b;
   return n;
}
int main(){
    int a,b,c,d,x,y,z;
    while(cin>>x>>y){
    a=x;
    b=y;
    c=1;
      for(d=0;c>0;d++){
         c=f(a,b);
         a=b;
         b=c;
    }
    z=x*y/a;
    cout<<a<<" "<<z<<endl;
         }
         return 0;
}