while line = gets
  (a, b) = line.split.map(&:to_i)
  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

  while true
    q = a / b;
    r = a % b;
    break if (r == 0)
    a = b;
    b = r;
  end
  printf("%d %d\n", b, least_common_multiple)
end