#coding: utf-8
STDOUT.sync = true

def gcd(x, y)
  while ((z = x % y) != 0) do
    x = y;
	y = z;
  end
  return y
end

def lcm(x, y)
  return x * y / gcd(x, y)
end


while data = STDIN.gets do
  num = data.split().map!(&:to_i)
  ans_g = gcd(num[0], num[1])
  ans_l = lcm(num[0], num[1])
  printf("%d %d\n", ans_g, ans_l)
end