def GCD(a, b):
	if b > a:
		return GCD(b, a)
	elif a % b == 0:
		return b
	return GCD(b, a % b)
		
def LCM(a, b):
	return a * b // GCD(a, b)

import sys
L = sys.stdin.readlines()
for line in L:
	x, y = list(map(int, line.split()))
	print(GCD(x, y), LCM(x, y)) def GCD(a, b):
	if b > a:
		return GCD(b, a)
	elif a % b == 0:
		return b
	return GCD(b, a % b)
		 GCD if b > a:
		return GCD(b, a)
	elif a % b == 0:
		return b
	 b > a b a return GCD(b, a) GCD(b, a) GCD b a elif a % b == 0:
		return b
	 a % b == 0 a % b a b 0 return b b return GCD(b, a % b) GCD(b, a % b) GCD b a % b a b 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 import sys sys L = sys.stdin.readlines() L sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines for line in L:
	x, y = list(map(int, line.split()))
	print(GCD(x, y), LCM(x, y)) line L x, y = list(map(int, line.split())) x list(map(int, line.split())) list map(int, line.split()) map int line.split() line.split line split y print(GCD(x, y), LCM(x, y)) print GCD(x, y) GCD x y LCM(x, y) LCM x y x, y = list(map(int, line.split())) list(map(int, line.split())) x y = list(map(int, line.split())) list(map(int, line.split())) y def GCD(a, b):
	if b > a:
		return GCD(b, a)
	elif a % b == 0:
		return b
	return GCD(b, a % b)
		 def GCD(a, b):
	if b > a:
		return GCD(b, a)
	elif a % b == 0:
		return b
	return GCD(b, a % b)
		 GCD def LCM(a, b):
	return a * b // GCD(a, b) def LCM(a, b):
	return a * b // GCD(a, b) LCM L = sys.stdin.readlines() sys.stdin.readlines() L
def GCD(a, b):
	if b > a:
		return GCD(b, a)
	elif a % b == 0:
		return b
	return GCD(b, a % b)
		
def LCM(a, b):
	return a * b // GCD(a, b)

import sys
L = sys.stdin.readlines()
for line in L:
	x, y = list(map(int, line.split()))
	print(GCD(x, y), LCM(x, y))