# coding:utf-8
import sys

# 最大公約数
def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a

# 最小公倍数
def lcm(a, b):
  return a*b/gcd(a, b)

for s in sys.stdin:
  a, b = map(int,s.split())
  gcd_num = gcd(a, b)
  lcm_num = lcm(a, b)
  print "%d %d"%(gcd_num, lcm_num) import sys sys def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a

# 最小公倍数 gcd while b > 0:
    a, b = b, a%b
   b > 0 b 0 a, b = b, a%b a b b a%b a b return a a 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 for s in sys.stdin:
  a, b = map(int,s.split())
  gcd_num = gcd(a, b)
  lcm_num = lcm(a, b)
  print "%d %d"%(gcd_num, lcm_num) s sys.stdin sys stdin a, b = map(int,s.split()) a map(int,s.split()) map int s.split() s.split s split b gcd_num = gcd(a, b) gcd_num gcd(a, b) gcd a b lcm_num = lcm(a, b) lcm_num lcm(a, b) lcm a b print "%d %d"%(gcd_num, lcm_num) "%d %d" (gcd_num, lcm_num) gcd_num lcm_num gcd_num = gcd(a, b) gcd(a, b) gcd_num def lcm(a, b):
  return a*b/gcd(a, b) def lcm(a, b):
  return a*b/gcd(a, b) lcm b = map(int,s.split()) map(int,s.split()) b lcm_num = lcm(a, b) lcm(a, b) lcm_num a, b = map(int,s.split()) map(int,s.split()) a def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a

# 最小公倍数 def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a

# 最小公倍数 gcd
# coding:utf-8
import sys

# 最大公約数
def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a

# 最小公倍数
def lcm(a, b):
  return a*b/gcd(a, b)

for s in sys.stdin:
  a, b = map(int,s.split())
  gcd_num = gcd(a, b)
  lcm_num = lcm(a, b)
  print "%d %d"%(gcd_num, lcm_num)