def gcd(x, y):
  if x < y:
    tmp = x
    x = y
    y = tmp
  while True:
    if y == 0:
      break
    x = x % y
    tmp = x
    x = y
    y = tmp

  return x

def lcm(x, y):
  return x * y / gcd(x, y)

while True:
  try:
    a, b = map(int, input().split())
    print(gcd(a, b), int(lcm(a, b)))
  except EOFError:
    break def gcd(x, y):
  if x < y:
    tmp = x
    x = y
    y = tmp
  while True:
    if y == 0:
      break
    x = x % y
    tmp = x
    x = y
    y = tmp

  return x gcd if x < y:
    tmp = x
    x = y
    y = tmp
   x < y x y tmp = x tmp x x = y x y y = tmp y tmp while True:
    if y == 0:
      break
    x = x % y
    tmp = x
    x = y
    y = tmp

   True if y == 0:
      break
     y == 0 y 0 break x = x % y x x % y x y tmp = x tmp x x = y x y y = tmp y tmp return x x x x y y def lcm(x, y):
  return x * y / gcd(x, y) lcm return x * y / gcd(x, y) x * y / gcd(x, y) x * y x y gcd(x, y) gcd x y x x y y while True:
  try:
    a, b = map(int, input().split())
    print(gcd(a, b), int(lcm(a, b)))
  except EOFError:
    break True try:
    a, b = map(int, input().split())
    print(gcd(a, b), int(lcm(a, b)))
  except EOFError:
    break except EOFError:
    break break a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b print(gcd(a, b), int(lcm(a, b))) print gcd(a, b) gcd a b int(lcm(a, b)) int lcm(a, b) lcm a b a, b = map(int, input().split()) map(int, input().split()) a def gcd(x, y):
  if x < y:
    tmp = x
    x = y
    y = tmp
  while True:
    if y == 0:
      break
    x = x % y
    tmp = x
    x = y
    y = tmp

  return x def gcd(x, y):
  if x < y:
    tmp = x
    x = y
    y = tmp
  while True:
    if y == 0:
      break
    x = x % y
    tmp = x
    x = y
    y = tmp

  return x gcd def lcm(x, y):
  return x * y / gcd(x, y) def lcm(x, y):
  return x * y / gcd(x, y) lcm b = map(int, input().split()) map(int, input().split()) b
def gcd(x, y):
  if x < y:
    tmp = x
    x = y
    y = tmp
  while True:
    if y == 0:
      break
    x = x % y
    tmp = x
    x = y
    y = tmp

  return x

def lcm(x, y):
  return x * y / gcd(x, y)

while True:
  try:
    a, b = map(int, input().split())
    print(gcd(a, b), int(lcm(a, b)))
  except EOFError:
    break