import math
while True:
  try:
    a,b=map(int,input().split())
    def lcm(x,y):
      return (x*y)//math.gcd(x,y)
    print(math.gcd(a,b),lcm(a,b))
  except:
    break import math math while True:
  try:
    a,b=map(int,input().split())
    def lcm(x,y):
      return (x*y)//math.gcd(x,y)
    print(math.gcd(a,b),lcm(a,b))
  except:
    break True try:
    a,b=map(int,input().split())
    def lcm(x,y):
      return (x*y)//math.gcd(x,y)
    print(math.gcd(a,b),lcm(a,b))
  except:
    break except:
    break break a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b def lcm(x,y):
      return (x*y)//math.gcd(x,y)
     lcm return (x*y)//math.gcd(x,y) (x*y)//math.gcd(x,y) x*y x y math.gcd(x,y) math.gcd math gcd x y x x y y print(math.gcd(a,b),lcm(a,b)) print math.gcd(a,b) math.gcd math gcd a b lcm(a,b) lcm a b def lcm(x,y):
      return (x*y)//math.gcd(x,y)
     def lcm(x,y):
      return (x*y)//math.gcd(x,y)
     lcm a,b=map(int,input().split()) map(int,input().split()) a b=map(int,input().split()) map(int,input().split()) b
import math
while True:
  try:
    a,b=map(int,input().split())
    def lcm(x,y):
      return (x*y)//math.gcd(x,y)
    print(math.gcd(a,b),lcm(a,b))
  except:
    break
