#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def main():
	while True:		
		try:
			a, b = [int(x) for x in input().split(" ")]
		except:
			return
		else:
			print(gcd(a, b),lcm(a, b))
def lcm(a, b):
	return (a * b) // gcd(a,b)
def gcd(a, b):
	while b != 0:
		a, b = b, a % b
	return a	
			
if __name__ == '__main__':
  main() def main():
	while True:		
		try:
			a, b = [int(x) for x in input().split(" ")]
		except:
			return
		else:
			print(gcd(a, b),lcm(a, b)) main while True:		
		try:
			a, b = [int(x) for x in input().split(" ")]
		except:
			return
		else:
			print(gcd(a, b),lcm(a, b)) True try:
			a, b = [int(x) for x in input().split(" ")]
		except:
			return
		else:
			print(gcd(a, b),lcm(a, b)) except:
			return
		 return int(x) for x in input().split(" ") for x in input().split(" ") x input().split(" ") ().split () input split " " for x in input().split(" ") int(x) int x a, b = [int(x) for x in input().split(" ")] a [int(x) for x in input().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) 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 def gcd(a, b):
	while b != 0:
		a, b = b, a % b
	return a	
			 gcd while b != 0:
		a, b = b, a % b
	 b != 0 b 0 a, b = b, a % b a b b a % b a b return a a a a b b if __name__ == '__main__':
  main() __name__ == '__main__' __name__ '__main__' main() main def main():
	while True:		
		try:
			a, b = [int(x) for x in input().split(" ")]
		except:
			return
		else:
			print(gcd(a, b),lcm(a, b)) def main():
	while True:		
		try:
			a, b = [int(x) for x in input().split(" ")]
		except:
			return
		else:
			print(gcd(a, b),lcm(a, b)) main def gcd(a, b):
	while b != 0:
		a, b = b, a % b
	return a	
			 def gcd(a, b):
	while b != 0:
		a, b = b, a % b
	return a	
			 gcd def lcm(a, b):
	return (a * b) // gcd(a,b) def lcm(a, b):
	return (a * b) // gcd(a,b) lcm
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def main():
	while True:		
		try:
			a, b = [int(x) for x in input().split(" ")]
		except:
			return
		else:
			print(gcd(a, b),lcm(a, b))
def lcm(a, b):
	return (a * b) // gcd(a,b)
def gcd(a, b):
	while b != 0:
		a, b = b, a % b
	return a	
			
if __name__ == '__main__':
  main()