#include<stdio.h>
#include<math.h>
#include<iostream.h>
#include<stdlib.h>
int gcd(int m,int n)
{
return n==0?m: gcd(n,m%n);
}
int main()
{
int m,n;
while(scanf("%d%d",&m,&n)!=EOF)
{
printf("%d %d\n",gcd(m,n),((m*n)/gcd(m,n)));
getchar();
}
return 0;
}