import std.stdio;
import std.conv;
import std.array;
import std.math;
import std.algorithm;
import std.string;

public int gcd(int m, int n)
{
	if ((m == 0) || (n == 0)) return 0;
	
	while (m != n)
	{
		if (m > n) m = m - n;
		else n = n - m;
	}
	return m;
}

public int lcm(int m, int n)
{
	if ((m == 0) || (n == 0)) return 0;
	return ((m / gcd(m, n) * n));
}

int main()
{
	string s;
	while((s = readln()).length != 0)
	{
		string[] _s = split(s);
		int a = to!int(_s[0]);
		int b = to!int(_s[1]);
		int x = gcd(a,b);
		int y = lcm(a,b);

		printf("%d %d\n",x,y); 
	}
	return 0;
}