#include <stdio.h>
int GCD(int a, int b)
{
	return b == 0 ? a : GCD(b, a%b);
}
long long int lcm(long long int a, long long int b)
{
	return (a*b / GCD(a, b));
}

int main()
{ int a, b; while (scanf("%d%d", &a, &b) != EOF)printf("%d %d\n", GCD(a, b),lcm(a,b)); return 0; }