import sys
def gcd(x, y):
  if y == 0:
    return x
  else:
    return gcd(y, x%y)

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

for line in sys.stdin:
  x, y = map(int, line.split())
  print(gcd(x, y), lcm(x,y)) import sys sys def gcd(x, y):
  if y == 0:
    return x
  else:
    return gcd(y, x%y) gcd if y == 0:
    return x
  else:
    return gcd(y, x%y) y == 0 y 0 return x x return gcd(y, x%y) gcd(y, x%y) gcd y x%y x y 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 for line in sys.stdin:
  x, y = map(int, line.split())
  print(gcd(x, y), lcm(x,y)) line sys.stdin sys stdin x, y = map(int, line.split()) x map(int, line.split()) map int line.split() line.split line split y print(gcd(x, y), lcm(x,y)) print gcd(x, y) gcd x y lcm(x,y) lcm x y x, y = map(int, line.split()) map(int, line.split()) x def lcm(x, y):
  return x * y //gcd(x,y)
     def lcm(x, y):
  return x * y //gcd(x,y)
     lcm y = map(int, line.split()) map(int, line.split()) y def gcd(x, y):
  if y == 0:
    return x
  else:
    return gcd(y, x%y) def gcd(x, y):
  if y == 0:
    return x
  else:
    return gcd(y, x%y) gcd
import sys
def gcd(x, y):
  if y == 0:
    return x
  else:
    return gcd(y, x%y)

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

for line in sys.stdin:
  x, y = map(int, line.split())
  print(gcd(x, y), lcm(x,y))