import sys

def gcd(a,b):
	a,b=max(a,b),min(a,b)
	while a%b:
		a,b=b,a%b
	return b
	
def lcm(a,b):
	return a//gcd(a,b)*b
	
for i in sys.stdin:
	a,b=map(int,i.split())
	print(gcd(a,b),lcm(a,b)) import sys sys def gcd(a,b):
	a,b=max(a,b),min(a,b)
	while a%b:
		a,b=b,a%b
	return b
	 gcd a,b=max(a,b),min(a,b) a max(a,b) max a b b min(a,b) min a b while a%b:
		a,b=b,a%b
	 a%b a b a,b=b,a%b a b b a%b a b return b b a a b b def lcm(a,b):
	return a//gcd(a,b)*b
	 lcm return a//gcd(a,b)*b a//gcd(a,b)*b a//gcd(a,b) a gcd(a,b) gcd a b b a a b b for i in sys.stdin:
	a,b=map(int,i.split())
	print(gcd(a,b),lcm(a,b)) i sys.stdin sys stdin a,b=map(int,i.split()) a map(int,i.split()) map int i.split() i.split i split b print(gcd(a,b),lcm(a,b)) print gcd(a,b) gcd a b lcm(a,b) lcm a b a,b=map(int,i.split()) map(int,i.split()) a def lcm(a,b):
	return a//gcd(a,b)*b
	 def lcm(a,b):
	return a//gcd(a,b)*b
	 lcm def gcd(a,b):
	a,b=max(a,b),min(a,b)
	while a%b:
		a,b=b,a%b
	return b
	 def gcd(a,b):
	a,b=max(a,b),min(a,b)
	while a%b:
		a,b=b,a%b
	return b
	 gcd b=map(int,i.split()) map(int,i.split()) b
import sys

def gcd(a,b):
	a,b=max(a,b),min(a,b)
	while a%b:
		a,b=b,a%b
	return b
	
def lcm(a,b):
	return a//gcd(a,b)*b
	
for i in sys.stdin:
	a,b=map(int,i.split())
	print(gcd(a,b),lcm(a,b))