def gcd(a, b):
	if b == 0: return a
	else: return gcd(b, a % b)

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

while True:
	try:
		a, b = map(int, input().split())
		print(int(gcd(a, b)), int(lcm(a, b)))
	except EOFError:
		break def gcd(a, b):
	if b == 0: return a
	else: return gcd(b, a % b) gcd if b == 0: return a
	else: return gcd(b, a % b) b == 0 b 0 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:
		a, b = map(int, input().split())
		print(int(gcd(a, b)), int(lcm(a, b)))
	except EOFError:
		break True try:
		a, b = map(int, input().split())
		print(int(gcd(a, b)), int(lcm(a, b)))
	except EOFError:
		break except EOFError:
		break break a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b print(int(gcd(a, b)), int(lcm(a, b))) print int(gcd(a, b)) int gcd(a, b) gcd a b int(lcm(a, b)) int lcm(a, b) lcm a b def gcd(a, b):
	if b == 0: return a
	else: return gcd(b, a % b) def gcd(a, b):
	if b == 0: return a
	else: return gcd(b, a % b) gcd b = map(int, input().split()) map(int, input().split()) b a, b = map(int, input().split()) map(int, input().split()) a def lcm(a, b):
	return a * b / gcd(a, b) def lcm(a, b):
	return a * b / gcd(a, b) lcm
def gcd(a, b):
	if b == 0: return a
	else: return gcd(b, a % b)

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

while True:
	try:
		a, b = map(int, input().split())
		print(int(gcd(a, b)), int(lcm(a, b)))
	except EOFError:
		break