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

def get_lcm(a,b,g):
	return a * b / g

while True:
	try:
		a,b = map(int, sorted(raw_input().split()))
		GCD = get_gcd(a,b)
		LCM = get_lcm(a,b,GCD)
		print "{} {}".format(GCD, LCM)
	except EOFError:
		break def get_gcd(a,b):
	if a > b: a, b = b, a
	if b % a == 0:
		return a
	else:
		return get_gcd(a, b % a) get_gcd if a > b: a, b = b, a
	 a > b a b if b % a == 0:
		return a
	else:
		return get_gcd(a, b % a) b % a == 0 b % a b a 0 return a a return get_gcd(a, b % a) get_gcd(a, b % a) get_gcd a b % a b a a a b b def get_lcm(a,b,g):
	return a * b / g get_lcm return a * b / g a * b / g a * b a b g a a b b g g while True:
	try:
		a,b = map(int, sorted(raw_input().split()))
		GCD = get_gcd(a,b)
		LCM = get_lcm(a,b,GCD)
		print "{} {}".format(GCD, LCM)
	except EOFError:
		break True try:
		a,b = map(int, sorted(raw_input().split()))
		GCD = get_gcd(a,b)
		LCM = get_lcm(a,b,GCD)
		print "{} {}".format(GCD, LCM)
	except EOFError:
		break except EOFError:
		break break a,b = map(int, sorted(raw_input().split())) a map(int, sorted(raw_input().split())) map int sorted(raw_input().split()) sorted raw_input().split() ().split () raw_input split b GCD = get_gcd(a,b) GCD get_gcd(a,b) get_gcd a b LCM = get_lcm(a,b,GCD) LCM get_lcm(a,b,GCD) get_lcm a b GCD print "{} {}".format(GCD, LCM) "{} {}".format "{} {}" format GCD LCM a,b = map(int, sorted(raw_input().split())) map(int, sorted(raw_input().split())) a GCD = get_gcd(a,b) get_gcd(a,b) GCD b = map(int, sorted(raw_input().split())) map(int, sorted(raw_input().split())) b LCM = get_lcm(a,b,GCD) get_lcm(a,b,GCD) LCM def get_gcd(a,b):
	if a > b: a, b = b, a
	if b % a == 0:
		return a
	else:
		return get_gcd(a, b % a) def get_gcd(a,b):
	if a > b: a, b = b, a
	if b % a == 0:
		return a
	else:
		return get_gcd(a, b % a) get_gcd def get_lcm(a,b,g):
	return a * b / g def get_lcm(a,b,g):
	return a * b / g get_lcm
def get_gcd(a,b):
	if a > b: a, b = b, a
	if b % a == 0:
		return a
	else:
		return get_gcd(a, b % a)

def get_lcm(a,b,g):
	return a * b / g

while True:
	try:
		a,b = map(int, sorted(raw_input().split()))
		GCD = get_gcd(a,b)
		LCM = get_lcm(a,b,GCD)
		print "{} {}".format(GCD, LCM)
	except EOFError:
		break