import math

while True:
	try:
		a,b=list(map(int,input().split()))
		x=math.gcd(a,b)
		y=int(a*b/x)
		print("%d %d"%(x,y))
	except:
		break import math math while True:
	try:
		a,b=list(map(int,input().split()))
		x=math.gcd(a,b)
		y=int(a*b/x)
		print("%d %d"%(x,y))
	except:
		break True try:
		a,b=list(map(int,input().split()))
		x=math.gcd(a,b)
		y=int(a*b/x)
		print("%d %d"%(x,y))
	except:
		break except:
		break break a,b=list(map(int,input().split())) a list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split b x=math.gcd(a,b) x math.gcd(a,b) math.gcd math gcd a b y=int(a*b/x) y int(a*b/x) int a*b/x a*b a b x print("%d %d"%(x,y)) print "%d %d"%(x,y) "%d %d" (x,y) x y a,b=list(map(int,input().split())) list(map(int,input().split())) a x=math.gcd(a,b) math.gcd(a,b) x b=list(map(int,input().split())) list(map(int,input().split())) b y=int(a*b/x) int(a*b/x) y
import math

while True:
	try:
		a,b=list(map(int,input().split()))
		x=math.gcd(a,b)
		y=int(a*b/x)
		print("%d %d"%(x,y))
	except:
		break
