def gcd(a,b):
	a,b=max(a,b),min(a,b)	
	while b!=0:
		a,b=b,a%b
	return a

def lcm(a,b):
	return a*b//gcd(a,b)


while True:
	try:
		x,y=map(int,input().split())
		print(gcd(x,y),lcm(x,y))

	except EOFError:
		break def gcd(a,b):
	a,b=max(a,b),min(a,b)	
	while b!=0:
		a,b=b,a%b
	return a gcd a,b=max(a,b),min(a,b) a max(a,b) max a b b min(a,b) min a b while b!=0:
		a,b=b,a%b
	 b!=0 b 0 a,b=b,a%b a b b a%b a b return a a a a b b def lcm(a,b):
	return a*b//gcd(a,b) lcm return a*b//gcd(a,b) a*b//gcd(a,b) a*b a b gcd(a,b) gcd a b a a b b while True:
	try:
		x,y=map(int,input().split())
		print(gcd(x,y),lcm(x,y))

	except EOFError:
		break True try:
		x,y=map(int,input().split())
		print(gcd(x,y),lcm(x,y))

	except EOFError:
		break except EOFError:
		break break x,y=map(int,input().split()) x map(int,input().split()) map int input().split() ().split () input split y print(gcd(x,y),lcm(x,y)) print gcd(x,y) gcd x y lcm(x,y) lcm x y def gcd(a,b):
	a,b=max(a,b),min(a,b)	
	while b!=0:
		a,b=b,a%b
	return a def gcd(a,b):
	a,b=max(a,b),min(a,b)	
	while b!=0:
		a,b=b,a%b
	return a gcd x,y=map(int,input().split()) map(int,input().split()) x def lcm(a,b):
	return a*b//gcd(a,b) def lcm(a,b):
	return a*b//gcd(a,b) lcm y=map(int,input().split()) map(int,input().split()) y
def gcd(a,b):
	a,b=max(a,b),min(a,b)	
	while b!=0:
		a,b=b,a%b
	return a

def lcm(a,b):
	return a*b//gcd(a,b)


while True:
	try:
		x,y=map(int,input().split())
		print(gcd(x,y),lcm(x,y))

	except EOFError:
		break