def gcd(m, n)
  return m if n == 0
  return gcd(n, m % n)
end
def lcm(m, n, g)
  return m * n / g
end
while gets do
  a, b = $_.chomp.split(/ /).map(&:to_i)
  g = gcd(a, b)
  l = lcm(a, b, g)
  puts "#{g} #{l}"
end