def nok (a,b):
	c=a
	d=b
	ia=1
	ib=1

	while c != d:
		if c < d:
			ia += 1
			c = a*ia
		else:
			ib+=1
			d = b*ib
		
	print(c, d)
	return c

z = int(input('a: '))
x = int(input('b: '))
nok(z, x)
input()