#include <stdio.h>

int main(){
long int a,b,aa,bb;
long int x,y;

while(scanf("%d %d",&a,&b) != EOF){
aa=a;
bb=b;
while(a%b!=0){
x=a%b;
a=b;
b=x;
}
for(i=1;i<=aa*bb;i++){
if(i%aa==0 && i%bb==0){
y=i;
break;
}
}
printf("%d %d\n",b,y);
}
return 0;
}