while line = gets
  a,b = line.split.map(&:to_i)
  a_times_b = a*b
  gcd = 1
  loop do
    c = a % b
    if c == 0
      gcd = b
      break
    else
      a,b = b,c
      # b = c
    end
  end
  lcm = a_times_b / gcd
  puts "#{gcd} #{lcm}"
end