# -*- coding:utf-8 -*-

import sys

def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b)

def lcm(a, b):
    return a * b / gcd(a, b)

array = []
for i in sys.stdin:
    array.append(i)

for i in range(len(array)):
    n, m = array[i].split()
    n, m = int(n), int(m)
    print(int(gcd(n, m)),int(lcm(n, m))) import sys sys def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b) gcd if b == 0: return a
     b == 0 b 0 return gcd(b, a % b) gcd(b, a % b) gcd b a % b a b 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 array = [] array [] for i in sys.stdin:
    array.append(i) i sys.stdin sys stdin array.append(i) array.append array append i for i in range(len(array)):
    n, m = array[i].split()
    n, m = int(n), int(m)
    print(int(gcd(n, m)),int(lcm(n, m))) i range(len(array)) range len(array) len array n, m = array[i].split() n array[i].split() [i].split [i] array i split m n, m = int(n), int(m) n int(n) int n m int(m) int m print(int(gcd(n, m)),int(lcm(n, m))) print int(gcd(n, m)) int gcd(n, m) gcd n m int(lcm(n, m)) int lcm(n, m) lcm n m n, m = array[i].split() array[i].split() n n, m = int(n), int(m) int(n) n def lcm(a, b):
    return a * b / gcd(a, b) def lcm(a, b):
    return a * b / gcd(a, b) lcm def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b) def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b) gcd m = array[i].split() array[i].split() m m = int(n), int(m) int(m) m array = [] [] array
# -*- coding:utf-8 -*-

import sys

def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b)

def lcm(a, b):
    return a * b / gcd(a, b)

array = []
for i in sys.stdin:
    array.append(i)

for i in range(len(array)):
    n, m = array[i].split()
    n, m = int(n), int(m)
    print(int(gcd(n, m)),int(lcm(n, m)))