#include<iostream>
#include<cstdio>
using namespace std;

int gcd(int a, int b)
{
	int c;

	while (a%b)
	{

		c = b;
		b = a%b;
		a = c;
	}
	return b;
}


int main()
{
	int a, b;
	while (scanf("%lld%lld", &a, &b))
	{
		cout << gcd(a, b) << " " <<a/gcd(a,b)*b<< endl;
	}
	return 0;
}