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