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

def lcm(n, m, g)
  (n*m)/g
end

while gets do
  a, b = $_.split(/\s/).map(&:to_i).sort
  g = gcd(a, b)
  l = lcm(a, b, g)
  puts "#{g} #{l}"
end