def gcd(a, b)
  a, b = b, a if a < b

  loop do
    r = a%b
    break if r == 0
    a, b = b, r
  end
  return b
end

def lcm(a, b)
  return a*b/gcd(a, b)
end

while gets do
  a, b = $_.split(' ').map(&:to_i)
  puts "#{gcd(a, b)} #{lcm(a, b)}"
end