def gcd(a, b)
  if (r = a % b) == 0
    return b
  else
    gcd(b, r)
  end
end

while line = gets do
  datas = line.split.map(&:to_i)
  datas.sort!
  g = gcd(datas[1], datas[0])
  l = datas[0] * datas[1] / g
  puts "#{g} #{l}"
end