import std.stdio;
import std.conv;
import std.algorithm;
import std.string;
import std.file;

void main ()
{
	string l;
	while((l = readln()).length >= 2)
	{
		int a, b, c, d, f, G, L;
		a = to!int(l.split()[0]), b = to!int(l.split()[1]);
		if(a < b)
		{
			c = a;
			a = b;
			b = c;
		}
		d = a, f = b;
		while(true)
		{
			c = d % f;
			if(c == 0) 
			{
				G = f;
				break;
			}else{
				d = f % c;
				if(d == 0)
				{
					G = c;
					break;
				}else{
					f = c % d;
					if(f == 0)
					{
						G = d;
						break;
					}
				}
			}
		}
		L = a / G * b;
		writefln("%d %d",G,L);
	}
}