import math
while True:
	try:
		a, b = map(int, input().split())
		print(int(math.gcd(a,b)),(a*b) // int(math.gcd(a,b)))
	except:
		break import math math while True:
	try:
		a, b = map(int, input().split())
		print(int(math.gcd(a,b)),(a*b) // int(math.gcd(a,b)))
	except:
		break True try:
		a, b = map(int, input().split())
		print(int(math.gcd(a,b)),(a*b) // int(math.gcd(a,b)))
	except:
		break except:
		break break a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b print(int(math.gcd(a,b)),(a*b) // int(math.gcd(a,b))) print int(math.gcd(a,b)) int math.gcd(a,b) math.gcd math gcd a b (a*b) // int(math.gcd(a,b)) a*b a b int(math.gcd(a,b)) int math.gcd(a,b) math.gcd math gcd a b b = map(int, input().split()) map(int, input().split()) b a, b = map(int, input().split()) map(int, input().split()) a
import math
while True:
	try:
		a, b = map(int, input().split())
		print(int(math.gcd(a,b)),(a*b) // int(math.gcd(a,b)))
	except:
		break
