while True:
    try: 
        a, b = map(int, input().split())
        cross = a * b

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

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

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

        if a < b:
            a, b = b, a
        while a % b != 0:
            a, b = b, a % b
        print(b, cross // b)
    except EOFError:
        break