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

r=[list(map(int,line.split())) for line in sys.stdin]
for i in r:
    o=gcd(i[0],i[1])
    p=i[0]*i[1]/o
    print(o,int(p))
 import sys sys def gcd(a,b):
    if a%b==0:
        return b
    return gcd(b,a%b) gcd if a%b==0:
        return b
     a%b==0 a%b a b 0 return b b return gcd(b,a%b) gcd(b,a%b) gcd b a%b a b a a b b list(map(int,line.split())) for line in sys.stdin for line in sys.stdin line sys.stdin sys stdin for line in sys.stdin list(map(int,line.split())) list map(int,line.split()) map int line.split() line.split line split r=[list(map(int,line.split())) for line in sys.stdin] r [list(map(int,line.split())) for line in sys.stdin] for i in r:
    o=gcd(i[0],i[1])
    p=i[0]*i[1]/o
    print(o,int(p)) i r o=gcd(i[0],i[1]) o gcd(i[0],i[1]) gcd i[0] i 0 i[1] i 1 p=i[0]*i[1]/o p i[0]*i[1]/o i[0]*i[1] i[0] i 0 i[1] i 1 o print(o,int(p)) print o int(p) int p r=[list(map(int,line.split())) for line in sys.stdin] [list(map(int,line.split())) for line in sys.stdin] r def gcd(a,b):
    if a%b==0:
        return b
    return gcd(b,a%b) def gcd(a,b):
    if a%b==0:
        return b
    return gcd(b,a%b) gcd o=gcd(i[0],i[1]) gcd(i[0],i[1]) o p=i[0]*i[1]/o i[0]*i[1]/o p
import sys
def gcd(a,b):
    if a%b==0:
        return b
    return gcd(b,a%b)

r=[list(map(int,line.split())) for line in sys.stdin]
for i in r:
    o=gcd(i[0],i[1])
    p=i[0]*i[1]/o
    print(o,int(p))

