def gcd(a, b)
  return a if b.zero?
  gcd(b, a.modulo(b))
end

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

loop do
  s = gets
  break if s.nil?
  a, b = s.chomp.split.map(&:to_i)
  puts "#{gcd(a, b)} #{lcm(a, b)}"
end