def calc_gcd(m, n)
  while true do
    tmp = n
    n = m % n
    m = tmp

    return m if n == 0
  end
end

def calc_gcm(m, n, gcd)
  m * n / gcd
end

while line = gets do
  a, b = line.chop.split(/\s+/).map { |s| s.to_i }
  gcd = calc_gcd(a, b)
  gcm = calc_gcm(a, b, gcd)

  puts("#{gcd} #{gcm}")
end

