a = []
b = []
count = 0

while n = gets
  ax, bx = n.chomp.split(" ")
  a[count], b[count] = ax.to_i, bx.to_i
  count += 1
end

for i in 0..count-1
  aa = a[i]
  bb = b[i]

  if b[i] > a[i]
    a[i] = b[i]
    b[i] = aa
  end

  while b[i] != 0
    c = a[i] % b[i]
    a[i] = b[i]
    b[i] = c
  end

  puts a[i].to_s + " " + ((aa/a[i])*(bb/a[i])*a[i]).to_s
end