import math
while True:
    try:
        a = list(map(int,input().split()))
        b = (math.gcd(a[0],a[1]))
        c = ((a[0]*a[1])//math.gcd(a[0],a[1]))
        print(b,c)
    except EOFError:
        break import math math while True:
    try:
        a = list(map(int,input().split()))
        b = (math.gcd(a[0],a[1]))
        c = ((a[0]*a[1])//math.gcd(a[0],a[1]))
        print(b,c)
    except EOFError:
        break True try:
        a = list(map(int,input().split()))
        b = (math.gcd(a[0],a[1]))
        c = ((a[0]*a[1])//math.gcd(a[0],a[1]))
        print(b,c)
    except EOFError:
        break except EOFError:
        break break a = list(map(int,input().split())) a list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split b = (math.gcd(a[0],a[1])) b math.gcd(a[0],a[1]) math.gcd math gcd a[0] a 0 a[1] a 1 c = ((a[0]*a[1])//math.gcd(a[0],a[1])) c (a[0]*a[1])//math.gcd(a[0],a[1]) a[0]*a[1] a[0] a 0 a[1] a 1 math.gcd(a[0],a[1]) math.gcd math gcd a[0] a 0 a[1] a 1 print(b,c) print b c b = (math.gcd(a[0],a[1])) math.gcd(a[0],a[1]) b c = ((a[0]*a[1])//math.gcd(a[0],a[1])) (a[0]*a[1])//math.gcd(a[0],a[1]) c a = list(map(int,input().split())) list(map(int,input().split())) a
import math
while True:
    try:
        a = list(map(int,input().split()))
        b = (math.gcd(a[0],a[1]))
        c = ((a[0]*a[1])//math.gcd(a[0],a[1]))
        print(b,c)
    except EOFError:
        break
