import std.stdio,std.string,std.conv;

immutable MAX = 2000000000;

int main(string[] argv)
{
    char[] buf;
	string[] ans;
	while(stdin.readln(buf)){
		if(buf.split(" ").length == 2){
			uint a = buf.chomp().split(" ")[0].to!int();
			uint b = buf.chomp().split(" ")[1].to!int();
			uint g = GCD(a,b);
			ulong l = LCM(a,b,g);
			if(l < MAX){
				ans ~= g.to!string ~ " " ~ l.to!string();
			}
		}
	}

	foreach(string str;ans){
		writeln(str);
	}

    return 0;
}

private int GCD(int a,int b){

	while(a != b){
		if(a < b){
			int tmp = b;
			b = a;
			a = tmp;
		}
		int tmp = b;
		b = a - b;
		a = tmp;
	}

	return a;
}

private ulong LCM(int a,int b,int g){
	return ((a/g) * (b/g))*g;
}