import sys
a=[map(int,i.split())for i in sys.stdin]
for i,j in a:
	c,d=i,j
	while d:
		if c > d:c,d = d,c
		d%=c
	print(c,i//c*j) import sys sys map(int,i.split())for i in sys.stdin for i in sys.stdin i sys.stdin sys stdin for i in sys.stdin map(int,i.split()) map int i.split() i.split i split a=[map(int,i.split())for i in sys.stdin] a [map(int,i.split())for i in sys.stdin] for i,j in a:
	c,d=i,j
	while d:
		if c > d:c,d = d,c
		d%=c
	print(c,i//c*j) i j a c,d=i,j c i d j while d:
		if c > d:c,d = d,c
		d%=c
	 d if c > d:c,d = d,c
		 c > d c d d%=c d c print(c,i//c*j) print c i//c*j i//c i c j c,d=i,j i c d=i,j j d d%=c c d a=[map(int,i.split())for i in sys.stdin] [map(int,i.split())for i in sys.stdin] a
import sys
a=[map(int,i.split())for i in sys.stdin]
for i,j in a:
	c,d=i,j
	while d:
		if c > d:c,d = d,c
		d%=c
	print(c,i//c*j)