import math
while True:
  try:
    a,b =map(int,input().split())
    c =math.gcd(a,b)
    d =a*b// math.gcd(a,b)
    print(c,d)
  except:
    break import math math while True:
  try:
    a,b =map(int,input().split())
    c =math.gcd(a,b)
    d =a*b// math.gcd(a,b)
    print(c,d)
  except:
    break True try:
    a,b =map(int,input().split())
    c =math.gcd(a,b)
    d =a*b// math.gcd(a,b)
    print(c,d)
  except:
    break except:
    break break a,b =map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b c =math.gcd(a,b) c math.gcd(a,b) math.gcd math gcd a b d =a*b// math.gcd(a,b) d a*b// math.gcd(a,b) a*b a b math.gcd(a,b) math.gcd math gcd a b print(c,d) print c d d =a*b// math.gcd(a,b) a*b// math.gcd(a,b) d a,b =map(int,input().split()) map(int,input().split()) a b =map(int,input().split()) map(int,input().split()) b c =math.gcd(a,b) math.gcd(a,b) c
import math
while True:
  try:
    a,b =map(int,input().split())
    c =math.gcd(a,b)
    d =a*b// math.gcd(a,b)
    print(c,d)
  except:
    break
