#include <stdio.h>
 
int yakusuu(int a,int b);
 
int main(void){
int a,b,c;
while(scanf("%d %d",&a,&b)!=EOF){
c=yakusuu(a,b);
printf("%d %d\n",c,(a*b/c));
}
return 0;
}
 
int yakusuu(int a,int b){
int n=2,c=1;
while(n<=a && n<=b){
if(a%n==0 && b%n==0){
a=a/n;
b=b/n;
c=c*n;
}
else{
n=n+1;
}
}
return c;
}