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

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

while s = gets do
  a, b = s.split(/\s/).map(&:to_i).sort

  gcd = get_GCD(a, b)
  lcm = get_LCM(a, b, gcd)
  puts "#{gcd} #{lcm}"
end