import math
import sys

while True:
	try:
		a,b = map(int, input().split())
		p = a
		q = b
		while True:
			r = p%q
			if r == 0:
				x = q
				break
			else:
				p = q
				q = r
		i = 1
		while True:
			if a*i%b == 0:
				y = a*i
				break
			else:
				i = i+1
		print(x,y)
	except EOFError:
		break import math math import sys sys while True:
	try:
		a,b = map(int, input().split())
		p = a
		q = b
		while True:
			r = p%q
			if r == 0:
				x = q
				break
			else:
				p = q
				q = r
		i = 1
		while True:
			if a*i%b == 0:
				y = a*i
				break
			else:
				i = i+1
		print(x,y)
	except EOFError:
		break True try:
		a,b = map(int, input().split())
		p = a
		q = b
		while True:
			r = p%q
			if r == 0:
				x = q
				break
			else:
				p = q
				q = r
		i = 1
		while True:
			if a*i%b == 0:
				y = a*i
				break
			else:
				i = i+1
		print(x,y)
	except EOFError:
		break except EOFError:
		break break a,b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b p = a p a q = b q b while True:
			r = p%q
			if r == 0:
				x = q
				break
			else:
				p = q
				q = r
		 True r = p%q r p%q p q if r == 0:
				x = q
				break
			else:
				p = q
				q = r
		 r == 0 r 0 x = q x q break p = q p q q = r q r i = 1 i 1 while True:
			if a*i%b == 0:
				y = a*i
				break
			else:
				i = i+1
		 True if a*i%b == 0:
				y = a*i
				break
			else:
				i = i+1
		 a*i%b == 0 a*i%b a*i a i b 0 y = a*i y a*i a i break i = i+1 i i+1 i 1 print(x,y) print x y i = 1 1 i b = map(int, input().split()) map(int, input().split()) b p = q q p p = a a p r = p%q p%q r a,b = map(int, input().split()) map(int, input().split()) a q = b b q y = a*i a*i y i = i+1 i+1 i x = q q x q = r r q
import math
import sys

while True:
	try:
		a,b = map(int, input().split())
		p = a
		q = b
		while True:
			r = p%q
			if r == 0:
				x = q
				break
			else:
				p = q
				q = r
		i = 1
		while True:
			if a*i%b == 0:
				y = a*i
				break
			else:
				i = i+1
		print(x,y)
	except EOFError:
		break