#include <cstdio>
#include <algorithm>

using namespace std;

int main()
{
	int a, b;
	while (~scanf("%d %d", &a, &b)){
		int gcd = __gcd(a, b);
		printf("%d %d\n", gcd, a / gcd * b);
	}
	return (0);
}