import fractions
while True:
	try:
		x,y = map(int,raw_input().split())
		print '%d %d' % (fractions.gcd(x,y),x/fractions.gcd(x,y)*y)
	except EOFError:
		break import fractions fractions while True:
	try:
		x,y = map(int,raw_input().split())
		print '%d %d' % (fractions.gcd(x,y),x/fractions.gcd(x,y)*y)
	except EOFError:
		break True try:
		x,y = map(int,raw_input().split())
		print '%d %d' % (fractions.gcd(x,y),x/fractions.gcd(x,y)*y)
	except EOFError:
		break except EOFError:
		break break x,y = map(int,raw_input().split()) x map(int,raw_input().split()) map int raw_input().split() ().split () raw_input split y print '%d %d' % (fractions.gcd(x,y),x/fractions.gcd(x,y)*y) '%d %d' (fractions.gcd(x,y),x/fractions.gcd(x,y)*y) fractions.gcd(x,y) fractions.gcd fractions gcd x y x/fractions.gcd(x,y)*y x/fractions.gcd(x,y) x fractions.gcd(x,y) fractions.gcd fractions gcd x y y x,y = map(int,raw_input().split()) map(int,raw_input().split()) x y = map(int,raw_input().split()) map(int,raw_input().split()) y
import fractions
while True:
	try:
		x,y = map(int,raw_input().split())
		print '%d %d' % (fractions.gcd(x,y),x/fractions.gcd(x,y)*y)
	except EOFError:
		break