gcd, lcm = [], []
while True:
	try:
		a, b = map(int, raw_input().split())
		if a > b:
			m, n = a, b
		else:
			m, n = b, a		

		while n != 0:
			m, n = n, m % n 
		gcd.append(m)
		lcm.append(a * b / m)
	except EOFError:
		break

for gcd, lcm in zip(gcd, lcm):
	print '%d %d' % (gcd, lcm) gcd, lcm = [], [] gcd [] lcm [] while True:
	try:
		a, b = map(int, raw_input().split())
		if a > b:
			m, n = a, b
		else:
			m, n = b, a		

		while n != 0:
			m, n = n, m % n 
		gcd.append(m)
		lcm.append(a * b / m)
	except EOFError:
		break True try:
		a, b = map(int, raw_input().split())
		if a > b:
			m, n = a, b
		else:
			m, n = b, a		

		while n != 0:
			m, n = n, m % n 
		gcd.append(m)
		lcm.append(a * b / m)
	except EOFError:
		break except EOFError:
		break break a, b = map(int, raw_input().split()) a map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split b if a > b:
			m, n = a, b
		else:
			m, n = b, a		

		 a > b a b m, n = a, b m a n b m, n = b, a m b n a while n != 0:
			m, n = n, m % n 
		 n != 0 n 0 m, n = n, m % n m n n m % n m n gcd.append(m) gcd.append gcd append m lcm.append(a * b / m) lcm.append lcm append a * b / m a * b a b m for gcd, lcm in zip(gcd, lcm):
	print '%d %d' % (gcd, lcm) gcd lcm zip(gcd, lcm) zip gcd lcm print '%d %d' % (gcd, lcm) '%d %d' (gcd, lcm) gcd lcm gcd, lcm = [], [] [] gcd m, n = a, b a m m, n = n, m % n n m n = n, m % n m % n n a, b = map(int, raw_input().split()) map(int, raw_input().split()) a lcm = [], [] [] lcm n = a, b b n b = map(int, raw_input().split()) map(int, raw_input().split()) b m, n = b, a b m n = b, a a n
gcd, lcm = [], []
while True:
	try:
		a, b = map(int, raw_input().split())
		if a > b:
			m, n = a, b
		else:
			m, n = b, a		

		while n != 0:
			m, n = n, m % n 
		gcd.append(m)
		lcm.append(a * b / m)
	except EOFError:
		break

for gcd, lcm in zip(gcd, lcm):
	print '%d %d' % (gcd, lcm)