while True:
    try:
        r = sorted(list(map(int, input().split())))
        
        
        def euclidfunc(a, b):
            while b != 0:
                a, b = b, a % b
            return a
        
        
        def lcmfunc(a, b):
            return a * b // euclidfunc(a, b)
        
        
        print("{a} {b}".format(a=euclidfunc(r[1], r[0]), b=lcmfunc(r[1], r[0])))
    except EOFError:
        break
 while True:
    try:
        r = sorted(list(map(int, input().split())))
        
        
        def euclidfunc(a, b):
            while b != 0:
                a, b = b, a % b
            return a
        
        
        def lcmfunc(a, b):
            return a * b // euclidfunc(a, b)
        
        
        print("{a} {b}".format(a=euclidfunc(r[1], r[0]), b=lcmfunc(r[1], r[0])))
    except EOFError:
        break True try:
        r = sorted(list(map(int, input().split())))
        
        
        def euclidfunc(a, b):
            while b != 0:
                a, b = b, a % b
            return a
        
        
        def lcmfunc(a, b):
            return a * b // euclidfunc(a, b)
        
        
        print("{a} {b}".format(a=euclidfunc(r[1], r[0]), b=lcmfunc(r[1], r[0])))
    except EOFError:
        break except EOFError:
        break break r = sorted(list(map(int, input().split()))) r sorted(list(map(int, input().split()))) sorted list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def euclidfunc(a, b):
            while b != 0:
                a, b = b, a % b
            return a
        
        
         euclidfunc while b != 0:
                a, b = b, a % b
             b != 0 b 0 a, b = b, a % b a b b a % b a b return a a a a b b def lcmfunc(a, b):
            return a * b // euclidfunc(a, b)
        
        
         lcmfunc return a * b // euclidfunc(a, b) a * b // euclidfunc(a, b) a * b a b euclidfunc(a, b) euclidfunc a b a a b b print("{a} {b}".format(a=euclidfunc(r[1], r[0]), b=lcmfunc(r[1], r[0]))) print "{a} {b}".format(a=euclidfunc(r[1], r[0]), b=lcmfunc(r[1], r[0])) "{a} {b}".format "{a} {b}" format a=euclidfunc(r[1], r[0]) a euclidfunc(r[1], r[0]) euclidfunc r[1] r 1 r[0] r 0 b=lcmfunc(r[1], r[0]) b lcmfunc(r[1], r[0]) lcmfunc r[1] r 1 r[0] r 0 r = sorted(list(map(int, input().split()))) sorted(list(map(int, input().split()))) r def euclidfunc(a, b):
            while b != 0:
                a, b = b, a % b
            return a
        
        
         def euclidfunc(a, b):
            while b != 0:
                a, b = b, a % b
            return a
        
        
         euclidfunc def lcmfunc(a, b):
            return a * b // euclidfunc(a, b)
        
        
         def lcmfunc(a, b):
            return a * b // euclidfunc(a, b)
        
        
         lcmfunc
while True:
    try:
        r = sorted(list(map(int, input().split())))
        
        
        def euclidfunc(a, b):
            while b != 0:
                a, b = b, a % b
            return a
        
        
        def lcmfunc(a, b):
            return a * b // euclidfunc(a, b)
        
        
        print("{a} {b}".format(a=euclidfunc(r[1], r[0]), b=lcmfunc(r[1], r[0])))
    except EOFError:
        break

