while True:
    try:
        a, b = map(int, input().split())
        if a < b:
            b, a = a, b
        x, y = a, b
        while b: a, b = b, a%b
        gcd = a
        lcm = (x*y)//gcd
        print(gcd, lcm)
    except:
        break while True:
    try:
        a, b = map(int, input().split())
        if a < b:
            b, a = a, b
        x, y = a, b
        while b: a, b = b, a%b
        gcd = a
        lcm = (x*y)//gcd
        print(gcd, lcm)
    except:
        break True try:
        a, b = map(int, input().split())
        if a < b:
            b, a = a, b
        x, y = a, b
        while b: a, b = b, a%b
        gcd = a
        lcm = (x*y)//gcd
        print(gcd, lcm)
    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:
            b, a = a, b
         a < b a b b, a = a, b b a a b x, y = a, b x a y b while b: a, b = b, a%b
         b gcd = a gcd a lcm = (x*y)//gcd lcm (x*y)//gcd x*y x y gcd print(gcd, lcm) print gcd lcm a = a, b b a y = a, b b y lcm = (x*y)//gcd (x*y)//gcd lcm x, y = a, b a x gcd = a a gcd a, b = map(int, input().split()) map(int, input().split()) a b = map(int, input().split()) map(int, input().split()) b b, a = a, b a b
while True:
    try:
        a, b = map(int, input().split())
        if a < b:
            b, a = a, b
        x, y = a, b
        while b: a, b = b, a%b
        gcd = a
        lcm = (x*y)//gcd
        print(gcd, lcm)
    except:
        break