#include <iostream>
using namespace std;
int f(int x,int y){
if(x>y){
if(x%y==0){
return y;
}
f(y,x%y);
}else
if(x<y){
if(y%x==0){
return x;
}
f(x,y%x);
}
}
int ff(int x,int y){
if(x>y){
for(int i=x;i<=10000;i+=x){
if(i%y==0){
return i;
}
}
}else{
for(int i=y;i<=10000;i+=y){
if(i%x==0){
return i;
}
}
}
}
int main(){
int a,b;
cin>>a>>b;
cout<<f(a,b)<<" ";
cout<<ff(a,b);
return 0;
}