import sys
for line in sys.stdin:
    a,b = map(int, line.split())
    if a < b:
        a,b = b,a

    def gcd(x,y):
        while y > 0:
            x,y = y,x%y
        return x

    def lcm(x,y):
         return x * y / gcd(x, y)

    print(gcd(a,b), int(lcm(a,b))) import sys sys for line in sys.stdin:
    a,b = map(int, line.split())
    if a < b:
        a,b = b,a

    def gcd(x,y):
        while y > 0:
            x,y = y,x%y
        return x

    def lcm(x,y):
         return x * y / gcd(x, y)

    print(gcd(a,b), int(lcm(a,b))) line sys.stdin sys stdin a,b = map(int, line.split()) a map(int, line.split()) map int line.split() line.split line split b if a < b:
        a,b = b,a

     a < b a b a,b = b,a a b b a def gcd(x,y):
        while y > 0:
            x,y = y,x%y
        return x

     gcd while y > 0:
            x,y = y,x%y
         y > 0 y 0 x,y = y,x%y x y y x%y x y return x x x x y y def lcm(x,y):
         return x * y / gcd(x, y)

     lcm return x * y / gcd(x, y) x * y / gcd(x, y) x * y x y gcd(x, y) gcd x y x x y y print(gcd(a,b), int(lcm(a,b))) print gcd(a,b) gcd a b int(lcm(a,b)) int lcm(a,b) lcm a b a,b = map(int, line.split()) map(int, line.split()) a b = map(int, line.split()) map(int, line.split()) b def gcd(x,y):
        while y > 0:
            x,y = y,x%y
        return x

     def gcd(x,y):
        while y > 0:
            x,y = y,x%y
        return x

     gcd b = b,a a b a,b = b,a b a def lcm(x,y):
         return x * y / gcd(x, y)

     def lcm(x,y):
         return x * y / gcd(x, y)

     lcm
import sys
for line in sys.stdin:
    a,b = map(int, line.split())
    if a < b:
        a,b = b,a

    def gcd(x,y):
        while y > 0:
            x,y = y,x%y
        return x

    def lcm(x,y):
         return x * y / gcd(x, y)

    print(gcd(a,b), int(lcm(a,b)))