class Integer
def gcd(other)
  min = self.abs
  max = other.abs
  while min > 0
    tmp = min
    min = max % min
    max = tmp
  end
  max
end
def lcm(other)
  g = self.gcd(other)
  self * other / g
end
end

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