def gcd(a, b)
  while a != 0
    a, b = b%a, a
  end
  return b
end

readlines.map(&:chomp).each{|l|
  a, b = l.split.map(&:to_i).sort
  gcd = gcd(a, b)
  lcm = a * b / gcd
  puts [gcd, lcm].join(" ")
}