while True:
    try:
        a, b = map(int, input().split())
        x, y = a, b
        while y:
            x, y = y, x%y
        print(x,int(a*b/x))
    except:
        break while True:
    try:
        a, b = map(int, input().split())
        x, y = a, b
        while y:
            x, y = y, x%y
        print(x,int(a*b/x))
    except:
        break True try:
        a, b = map(int, input().split())
        x, y = a, b
        while y:
            x, y = y, x%y
        print(x,int(a*b/x))
    except:
        break except:
        break break a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b x, y = a, b x a y b while y:
            x, y = y, x%y
         y x, y = y, x%y x y y x%y x y print(x,int(a*b/x)) print x int(a*b/x) int a*b/x a*b a b x y = a, b b y y = y, x%y x%y y b = map(int, input().split()) map(int, input().split()) b a, b = map(int, input().split()) map(int, input().split()) a x, y = y, x%y y x x, y = a, b a x
while True:
    try:
        a, b = map(int, input().split())
        x, y = a, b
        while y:
            x, y = y, x%y
        print(x,int(a*b/x))
    except:
        break