def gcd(a, b):
  if b == 0:
    return a
  return gcd(b,  a % b)

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

while True:
  try:
    a, b = map(int, raw_input().split())
  except EOFError:
    break
  print "%d %d" % (gcd(a, b), lcm(a, b)) def gcd(a, b):
  if b == 0:
    return a
  return gcd(b,  a % b) gcd if b == 0:
    return a
   b == 0 b 0 return a a return gcd(b,  a % b) gcd(b,  a % b) gcd b a % b a b a a b b def lcm(a, b):
  return a * b / gcd(a, b) lcm return a * b / gcd(a, b) a * b / gcd(a, b) a * b a b gcd(a, b) gcd a b a a b b while True:
  try:
    a, b = map(int, raw_input().split())
  except EOFError:
    break
  print "%d %d" % (gcd(a, b), lcm(a, b)) True try:
    a, b = map(int, raw_input().split())
  except EOFError:
    break
   except EOFError:
    break
   break a, b = map(int, raw_input().split()) a map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split b print "%d %d" % (gcd(a, b), lcm(a, b)) "%d %d" (gcd(a, b), lcm(a, b)) gcd(a, b) gcd a b lcm(a, b) lcm a b b = map(int, raw_input().split()) map(int, raw_input().split()) b def gcd(a, b):
  if b == 0:
    return a
  return gcd(b,  a % b) def gcd(a, b):
  if b == 0:
    return a
  return gcd(b,  a % b) gcd def lcm(a, b):
  return a * b / gcd(a, b) def lcm(a, b):
  return a * b / gcd(a, b) lcm a, b = map(int, raw_input().split()) map(int, raw_input().split()) a
def gcd(a, b):
  if b == 0:
    return a
  return gcd(b,  a % b)

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

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