class Array
  def lcm
    self.inject{|a,b| a.lcm(b)}
  end

  def gcd
    self.inject{|a,b| a.gcd(b)}
  end
end

ARGF.each do |line|
  a, b = line.split.map(&:to_i)
  gcd = [a, b].gcd
  lcm = [a, b].lcm
  puts "#{gcd} #{lcm}"
end