divsor = []
d = []

while line = gets
  (a, b) = line.split.map(&:to_i)
  b < a ? big = a  : big = b
  if b < a
    big = a
    small = b
  else
    big = b
    small = a
  end

  tmp1 = big
  tmp2 = small

  while (tmp1 % small) != 0
    tmp1 += big
  end
  least_common_multiple = tmp1

  for i in 1..tmp2
    divsor.push(i) if tmp2 % i == 0
  end

  divsor.each do |i|
      d.push(i) if big % i == 0
  end

  printf("%d %d\n", d[-1], least_common_multiple)
end