###
### atcorder test program
###

import sys

### math class
class math:
    ### pi
    pi = 3.14159265358979323846264338

    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

math = math()

### output class
class output:
    ### list
    def list(self, l):
        l = list(l)
        print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()

### input sample
#i = input()
#A, B, C = [x for x in input().split()]
#inlist = [int(w) for w in input().split()]
#R = float(input())
#A = [int(x) for x in input().split()]
#for line in sys.stdin.readlines():
#    a, b = map(int, line.split())

### output sample
#print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
#print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
#print(" {}".format(i), end="")

for line in sys.stdin.readlines():
    x, y = [int(temp) for temp in line.split()]
    print("{} {}".format(math.gcd(x,y), math.lcm(x,y)))
     import sys sys class math:
    ### pi
    pi = 3.14159265358979323846264338

    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b) math pi = 3.14159265358979323846264338 pi 3.14159265358979323846264338 def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
     gcd if b == 0:
            return a
         b == 0 b 0 return a a return self.gcd(b, a%b) self.gcd(b, a%b) self.gcd self gcd b a%b a b self self a a b b def lcm(self, a, b):
        return (a*b)//self.gcd(a,b) lcm return (a*b)//self.gcd(a,b) (a*b)//self.gcd(a,b) a*b a b self.gcd(a,b) self.gcd self gcd a b self self a a b b math = math() math math() math class output:
    ### list
    def list(self, l):
        l = list(l)
        print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print() output def list(self, l):
        l = list(l)
        print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print() list l = list(l) l list(l) list l print(" ", end="") print " " end="" end "" for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
         i num enumerate(l) enumerate l print(num, end="") print num end="" end "" if i != len(l)-1:
                print(" ", end="")
         i != len(l)-1 i len(l)-1 len(l) len l 1 print(" ", end="") print " " end="" end "" print() print self self l l output = output() output output() output for line in sys.stdin.readlines():
    x, y = [int(temp) for temp in line.split()]
    print("{} {}".format(math.gcd(x,y), math.lcm(x,y)))
     line sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines int(temp) for temp in line.split() for temp in line.split() temp line.split() line.split line split for temp in line.split() int(temp) int temp x, y = [int(temp) for temp in line.split()] x [int(temp) for temp in line.split()] y print("{} {}".format(math.gcd(x,y), math.lcm(x,y))) print "{} {}".format(math.gcd(x,y), math.lcm(x,y)) "{} {}".format "{} {}" format math.gcd(x,y) math.gcd math gcd x y math.lcm(x,y) math.lcm math lcm x y math = math() math() math class math:
    ### pi
    pi = 3.14159265358979323846264338

    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b) class math:
    ### pi
    pi = 3.14159265358979323846264338

    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b) math output = output() output() output x, y = [int(temp) for temp in line.split()] [int(temp) for temp in line.split()] x class output:
    ### list
    def list(self, l):
        l = list(l)
        print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print() class output:
    ### list
    def list(self, l):
        l = list(l)
        print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print() output y = [int(temp) for temp in line.split()] [int(temp) for temp in line.split()] y
###
### atcorder test program
###

import sys

### math class
class math:
    ### pi
    pi = 3.14159265358979323846264338

    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

math = math()

### output class
class output:
    ### list
    def list(self, l):
        l = list(l)
        print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()

### input sample
#i = input()
#A, B, C = [x for x in input().split()]
#inlist = [int(w) for w in input().split()]
#R = float(input())
#A = [int(x) for x in input().split()]
#for line in sys.stdin.readlines():
#    a, b = map(int, line.split())

### output sample
#print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
#print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
#print(" {}".format(i), end="")

for line in sys.stdin.readlines():
    x, y = [int(temp) for temp in line.split()]
    print("{} {}".format(math.gcd(x,y), math.lcm(x,y)))
    
