ans=[]
while True:
	try:
		k,l=list(map(int,input().split(" ")))
		init_k=k
		init_l=l
#
		while True:
			if k%l==0:
				gcd=l
				tmp_1=init_k/gcd
				tmp_2=init_l/gcd
				lcm=gcd*tmp_1*tmp_2
				break
			else:
				tmp=k%l
				k=l
				l=tmp
		gcd=int(gcd)
		lcm=int(lcm)
		ans.append(str(gcd)+" "+str(lcm))
	except:
		break

for i in ans:
	print(i) ans=[] ans [] while True:
	try:
		k,l=list(map(int,input().split(" ")))
		init_k=k
		init_l=l
#
		while True:
			if k%l==0:
				gcd=l
				tmp_1=init_k/gcd
				tmp_2=init_l/gcd
				lcm=gcd*tmp_1*tmp_2
				break
			else:
				tmp=k%l
				k=l
				l=tmp
		gcd=int(gcd)
		lcm=int(lcm)
		ans.append(str(gcd)+" "+str(lcm))
	except:
		break True try:
		k,l=list(map(int,input().split(" ")))
		init_k=k
		init_l=l
#
		while True:
			if k%l==0:
				gcd=l
				tmp_1=init_k/gcd
				tmp_2=init_l/gcd
				lcm=gcd*tmp_1*tmp_2
				break
			else:
				tmp=k%l
				k=l
				l=tmp
		gcd=int(gcd)
		lcm=int(lcm)
		ans.append(str(gcd)+" "+str(lcm))
	except:
		break except:
		break break k,l=list(map(int,input().split(" "))) k list(map(int,input().split(" "))) list map(int,input().split(" ")) map int input().split(" ") ().split () input split " " l init_k=k init_k k init_l=l init_l l while True:
			if k%l==0:
				gcd=l
				tmp_1=init_k/gcd
				tmp_2=init_l/gcd
				lcm=gcd*tmp_1*tmp_2
				break
			else:
				tmp=k%l
				k=l
				l=tmp
		 True if k%l==0:
				gcd=l
				tmp_1=init_k/gcd
				tmp_2=init_l/gcd
				lcm=gcd*tmp_1*tmp_2
				break
			else:
				tmp=k%l
				k=l
				l=tmp
		 k%l==0 k%l k l 0 gcd=l gcd l tmp_1=init_k/gcd tmp_1 init_k/gcd init_k gcd tmp_2=init_l/gcd tmp_2 init_l/gcd init_l gcd lcm=gcd*tmp_1*tmp_2 lcm gcd*tmp_1*tmp_2 gcd*tmp_1 gcd tmp_1 tmp_2 break tmp=k%l tmp k%l k l k=l k l l=tmp l tmp gcd=int(gcd) gcd int(gcd) int gcd lcm=int(lcm) lcm int(lcm) int lcm ans.append(str(gcd)+" "+str(lcm)) ans.append ans append str(gcd)+" "+str(lcm) str(gcd)+" " str(gcd) str gcd " " str(lcm) str lcm for i in ans:
	print(i) i ans print(i) print i gcd=int(gcd) int(gcd) gcd ans=[] [] ans k,l=list(map(int,input().split(" "))) list(map(int,input().split(" "))) k init_k=k k init_k tmp_1=init_k/gcd init_k/gcd tmp_1 tmp_2=init_l/gcd init_l/gcd tmp_2 tmp=k%l k%l tmp l=tmp tmp l k=l l k gcd=l l gcd lcm=int(lcm) int(lcm) lcm lcm=gcd*tmp_1*tmp_2 gcd*tmp_1*tmp_2 lcm l=list(map(int,input().split(" "))) list(map(int,input().split(" "))) l init_l=l l init_l
ans=[]
while True:
	try:
		k,l=list(map(int,input().split(" ")))
		init_k=k
		init_l=l
#
		while True:
			if k%l==0:
				gcd=l
				tmp_1=init_k/gcd
				tmp_2=init_l/gcd
				lcm=gcd*tmp_1*tmp_2
				break
			else:
				tmp=k%l
				k=l
				l=tmp
		gcd=int(gcd)
		lcm=int(lcm)
		ans.append(str(gcd)+" "+str(lcm))
	except:
		break

for i in ans:
	print(i)