def gcd_and_lcm(nums)
  a = nums.max
  b = nums.min
  until b == 0
    tmp = b
    b = a % b
    a = tmp
  end
  gcd = tmp
  lcm = nums.max * nums.min / gcd
  return [gcd, lcm]
end

while line = gets
  data = line.chomp.split(" ").map(&:to_i)
  puts gcd_and_lcm(data).join(" ")
end