def gcd(a,b):
	while a>0 and b>0:
		if a<b:
			b -= a
		elif a>b:
			a -= b
		else:
			return a
	raise

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


while True:
	try:
		inp = raw_input()
	except EOFError:
		break
	a, b = map((lambda x: int(x) ), inp.split())

	print gcd(a,b),lcm(a,b) def gcd(a,b):
	while a>0 and b>0:
		if a<b:
			b -= a
		elif a>b:
			a -= b
		else:
			return a
	raise gcd while a>0 and b>0:
		if a<b:
			b -= a
		elif a>b:
			a -= b
		else:
			return a
	 a>0 and b>0 a>0 a 0 b>0 b 0 if a<b:
			b -= a
		elif a>b:
			a -= b
		else:
			return a
	 a<b a b b -= a b a elif a>b:
			a -= b
		 a>b a b a -= b a b return a a raise 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:
		inp = raw_input()
	except EOFError:
		break
	a, b = map((lambda x: int(x) ), inp.split())

	print gcd(a,b),lcm(a,b) True try:
		inp = raw_input()
	except EOFError:
		break
	 except EOFError:
		break
	 break inp = raw_input() inp raw_input() raw_input a, b = map((lambda x: int(x) ), inp.split()) a map((lambda x: int(x) ), inp.split()) map lambda x: int(x) int(x) int x x inp.split() inp.split inp split b print gcd(a,b) gcd a b lcm(a,b) lcm a b def lcm(a,b):
	return a*b/gcd(a,b) def lcm(a,b):
	return a*b/gcd(a,b) lcm inp = raw_input() raw_input() inp b = map((lambda x: int(x) ), inp.split()) map((lambda x: int(x) ), inp.split()) b def gcd(a,b):
	while a>0 and b>0:
		if a<b:
			b -= a
		elif a>b:
			a -= b
		else:
			return a
	raise def gcd(a,b):
	while a>0 and b>0:
		if a<b:
			b -= a
		elif a>b:
			a -= b
		else:
			return a
	raise gcd a, b = map((lambda x: int(x) ), inp.split()) map((lambda x: int(x) ), inp.split()) a
def gcd(a,b):
	while a>0 and b>0:
		if a<b:
			b -= a
		elif a>b:
			a -= b
		else:
			return a
	raise

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


while True:
	try:
		inp = raw_input()
	except EOFError:
		break
	a, b = map((lambda x: int(x) ), inp.split())

	print gcd(a,b),lcm(a,b)