class Array
  def product(ary)
    temp = self.clone
    result = []
    ary.each do |v|
      if temp.include?(v)
        result << temp.delete_at(temp.index(v))
      end
    end
    result
  end
end

# greatest common divisor(最大公約数)
def gcd(i)
  gcd_div = self.prime_div2.product(i.prime_div2)
  gcg_div.inject {|memo, item| memo * item }
end

# least common multiple(最小公倍数)
def lcm(i)
  lcm_div = self.prime_div2 + i.prime_div2
  lcm_div = lcm_div - self.prime_div2.product(i.prime_div2)
  lcm_div.inject {|memo, item| memo * item }
end

# エラトステネスの篩いによる素数列の生成
def eratosthenes(n)
  list = Array.new(n - 1).map.with_index {|i, k| k + 2}
  result = [1]
  while list.last >= result.last**2
    p = list.shift
    result << p
    list.delete_if {|v| v % p == 0 }
  end
  result.shift
  result = result + list
end

# 素因数分解して[2, 2, 2, 3]の様に返す。
def prime_div
  k = self
  c = 0
  result = []
  eratosthenes(n/2).each do |i|
    c = 0
    if k % i == 0
      while k % i == 0
        k = k / i
        result << k
      end
    end
  end
  result
end

while line = gets
  imput = line.chomp.split.map(&:to_i)
  print imput[0].gcd(imput[1]), " ", imput[0].lcm(imput[1])
end