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