def gcd(a, b)
  a, b = b, a if b > a

  while (c = a % b) != 0
    a, b = b, c
  end
  b
end

def lcm(a, b)
  a * b / gcd(a, b)
end

while line = gets
  a, b = line.split.map(&:to_i)
  gcd = gcd(a, b)
  lcm = lcm(a, b)
  puts "#{gcd} #{lcm}"
end