def gcd(n, m)
  n, m = m, n if m > n
  loop {
    r = n % m
    break if r == 0
    n, m = m, r
  }
  m
end

def lcm(n, m, g)
  n*m/g
end

while gets do
  a, b = $_.split(/\s/).map(&:to_i)
  g = gcd(a, b)
  l = lcm(a, b, g)
  print "#{g} #{l}"
end