#include<stdio.h>
#include<stdlib.h>
#include<algorithm>


int yukurid(int, int);

int main()
{
	int a, b, tmp;
	while (scanf("%d %d", &a, &b) != EOF)
	{
		tmp = a;
		a = a < b ? b : a;
		b = tmp < b ? tmp : b;
		printf("%d %d\n", yukurid(a, b),((a*b)/yukurid(a,b)));
	}
	return 0;

}

int yukurid(int a, int b)
{
	int tmp;
	if (a%b == 0)return b;
	else
	{
		tmp = a;
		a = b;
		b = tmp%b;
		return yukurid(a, b);
	}
}