while True:
    try:
        As,Bs = map(int,input().split())
        a,b = As, Bs
        while True:
            if a % b == 0:
                gcd = b
                break
            a,b = b, a % b
        print(gcd,int(As * Bs / gcd))
    except EOFError:
        break while True:
    try:
        As,Bs = map(int,input().split())
        a,b = As, Bs
        while True:
            if a % b == 0:
                gcd = b
                break
            a,b = b, a % b
        print(gcd,int(As * Bs / gcd))
    except EOFError:
        break True try:
        As,Bs = map(int,input().split())
        a,b = As, Bs
        while True:
            if a % b == 0:
                gcd = b
                break
            a,b = b, a % b
        print(gcd,int(As * Bs / gcd))
    except EOFError:
        break except EOFError:
        break break As,Bs = map(int,input().split()) As map(int,input().split()) map int input().split() ().split () input split Bs a,b = As, Bs a As b Bs while True:
            if a % b == 0:
                gcd = b
                break
            a,b = b, a % b
         True if a % b == 0:
                gcd = b
                break
             a % b == 0 a % b a b 0 gcd = b gcd b break a,b = b, a % b a b b a % b a b print(gcd,int(As * Bs / gcd)) print gcd int(As * Bs / gcd) int As * Bs / gcd As * Bs As Bs gcd a,b = As, Bs As a b = b, a % b a % b b Bs = map(int,input().split()) map(int,input().split()) Bs a,b = b, a % b b a gcd = b b gcd As,Bs = map(int,input().split()) map(int,input().split()) As b = As, Bs Bs b
while True:
    try:
        As,Bs = map(int,input().split())
        a,b = As, Bs
        while True:
            if a % b == 0:
                gcd = b
                break
            a,b = b, a % b
        print(gcd,int(As * Bs / gcd))
    except EOFError:
        break