#include <iostream>
#include <cstdio>

using namespace std;

typedef long long ll;

ll a, b;

ll gcd(ll a, ll b)
{
	if(!b)
		return a;
	if(a < b)
		return gcd(b, a);
	if(!(a&1) and !(b&1))
		return gcd(a>>1, b>>1)<<1;
	else if(!(a&1))
		return gcd(a>>1, b);
	else if(!(b&1))
		return gcd(a, b>>1);
	else
		return gcd(b, a-b);
}

ll lcm(ll g)
{
	return a*b/g;
}

int main()
{
	//freopen("in.txt", "r", stdin);
	while(true)
	{
		if(scanf("%lld", &a) == EOF || scanf("%lld", &b) == EOF)
			return 0;
		ll g = gcd(a, b);
		printf("%lld %lld\n", g, lcm(g));
	}
}
