#include <stdio.h>

int gcd( int m, int n)
{
if(n==0)
return m;
else
return gcd(n,m%n);
}

int lcm( int m, int n)
{
int gcd( int, int);
return( m * n / gcd (m , n));
}

int main()
{
int m, n , lcm( int, int), gcd( int ,int);
while(scanf("%d%d", &m,&n)==2){
printf("%d", gcd( m, n));
printf(" %d", lcm(m , n));}
return 0;
}