import sys
def gcd(a, b):
    for i in range(1, a+1):
        if a % i == 0:
            t = a // i
            if b % t == 0:
                return t
for line in sys.stdin:
    a, b = sorted(map(int, line.split()))
    gcdab = gcd(a, b)
    print(gcdab, a // gcdab * b) import sys sys def gcd(a, b):
    for i in range(1, a+1):
        if a % i == 0:
            t = a // i
            if b % t == 0:
                return t gcd for i in range(1, a+1):
        if a % i == 0:
            t = a // i
            if b % t == 0:
                return t i range(1, a+1) range 1 a+1 a 1 if a % i == 0:
            t = a // i
            if b % t == 0:
                return t a % i == 0 a % i a i 0 t = a // i t a // i a i if b % t == 0:
                return t b % t == 0 b % t b t 0 return t t a a b b for line in sys.stdin:
    a, b = sorted(map(int, line.split()))
    gcdab = gcd(a, b)
    print(gcdab, a // gcdab * b) line sys.stdin sys stdin a, b = sorted(map(int, line.split())) a sorted(map(int, line.split())) sorted map(int, line.split()) map int line.split() line.split line split b gcdab = gcd(a, b) gcdab gcd(a, b) gcd a b print(gcdab, a // gcdab * b) print gcdab a // gcdab * b a // gcdab a gcdab b b = sorted(map(int, line.split())) sorted(map(int, line.split())) b def gcd(a, b):
    for i in range(1, a+1):
        if a % i == 0:
            t = a // i
            if b % t == 0:
                return t def gcd(a, b):
    for i in range(1, a+1):
        if a % i == 0:
            t = a // i
            if b % t == 0:
                return t gcd a, b = sorted(map(int, line.split())) sorted(map(int, line.split())) a gcdab = gcd(a, b) gcd(a, b) gcdab
import sys
def gcd(a, b):
    for i in range(1, a+1):
        if a % i == 0:
            t = a // i
            if b % t == 0:
                return t
for line in sys.stdin:
    a, b = sorted(map(int, line.split()))
    gcdab = gcd(a, b)
    print(gcdab, a // gcdab * b)