while True:
    try:
        a, b = map(int, input().split(" "))
        if a < b:
            key = a
            a = b
            b = key
        A = a
        B = b
        while a % b != 0:
            key = a % b
            a = b
            b = key
        key = int(A * B / b)
        print(b, key)
    except:
        break while True:
    try:
        a, b = map(int, input().split(" "))
        if a < b:
            key = a
            a = b
            b = key
        A = a
        B = b
        while a % b != 0:
            key = a % b
            a = b
            b = key
        key = int(A * B / b)
        print(b, key)
    except:
        break True try:
        a, b = map(int, input().split(" "))
        if a < b:
            key = a
            a = b
            b = key
        A = a
        B = b
        while a % b != 0:
            key = a % b
            a = b
            b = key
        key = int(A * B / b)
        print(b, key)
    except:
        break except:
        break break a, b = map(int, input().split(" ")) a map(int, input().split(" ")) map int input().split(" ") ().split () input split " " b if a < b:
            key = a
            a = b
            b = key
         a < b a b key = a key a a = b a b b = key b key A = a A a B = b B b while a % b != 0:
            key = a % b
            a = b
            b = key
         a % b != 0 a % b a b 0 key = a % b key a % b a b a = b a b b = key b key key = int(A * B / b) key int(A * B / b) int A * B / b A * B A B b print(b, key) print b key key = a a key b = map(int, input().split(" ")) map(int, input().split(" ")) b B = b b B key = int(A * B / b) int(A * B / b) key a, b = map(int, input().split(" ")) map(int, input().split(" ")) a a = b b a key = a % b a % b key b = key key b b = key key b a = b b a A = a a A
while True:
    try:
        a, b = map(int, input().split(" "))
        if a < b:
            key = a
            a = b
            b = key
        A = a
        B = b
        while a % b != 0:
            key = a % b
            a = b
            b = key
        key = int(A * B / b)
        print(b, key)
    except:
        break
