def rec x, y
  z = [x, y].max % [x, y].min
  return [x, y].min if z == 0
  rec z, [x, y].min
end

while line = gets do
  a, b = line.split.map(&:to_i)
  ans1 = rec a, b
  ans2 = ans1 * (a/ans1) * (b/ans1)
  printf("%d %d\n", ans1, ans2)
end