def gcd(a, b):
    while b: 
    	a, b = b, a % b
    return a
 
while True:
    try:
        line = input()
    except:
        break
    a, b = map(int, line.strip().split())
    g = gcd(a, b)
    print(g, a * b // g) def gcd(a, b):
    while b: 
    	a, b = b, a % b
    return a
  gcd while b: 
    	a, b = b, a % b
     b a, b = b, a % b a b b a % b a b return a a a a b b while True:
    try:
        line = input()
    except:
        break
    a, b = map(int, line.strip().split())
    g = gcd(a, b)
    print(g, a * b // g) True try:
        line = input()
    except:
        break
     except:
        break
     break line = input() line input() input a, b = map(int, line.strip().split()) a map(int, line.strip().split()) map int line.strip().split() line.strip().split line.strip() line.strip line strip split b g = gcd(a, b) g gcd(a, b) gcd a b print(g, a * b // g) print g a * b // g a * b a b g a, b = map(int, line.strip().split()) map(int, line.strip().split()) a b = map(int, line.strip().split()) map(int, line.strip().split()) b def gcd(a, b):
    while b: 
    	a, b = b, a % b
    return a
  def gcd(a, b):
    while b: 
    	a, b = b, a % b
    return a
  gcd g = gcd(a, b) gcd(a, b) g line = input() input() line
def gcd(a, b):
    while b: 
    	a, b = b, a % b
    return a
 
while True:
    try:
        line = input()
    except:
        break
    a, b = map(int, line.strip().split())
    g = gcd(a, b)
    print(g, a * b // g)