def gcd(n1,n2):
    if n2==0:
        return n1
    return gcd(n2,n1%n2)

def lcm(n1,n2):
    return n1/gcd(n1,n2)*n2

while True:
    try:
        a,b=[int(i) for i in input().split()]
        print("{} {}".format(int(gcd(a,b)),int(lcm(a,b))))
    except:
        break def gcd(n1,n2):
    if n2==0:
        return n1
    return gcd(n2,n1%n2) gcd if n2==0:
        return n1
     n2==0 n2 0 return n1 n1 return gcd(n2,n1%n2) gcd(n2,n1%n2) gcd n2 n1%n2 n1 n2 n1 n1 n2 n2 def lcm(n1,n2):
    return n1/gcd(n1,n2)*n2 lcm return n1/gcd(n1,n2)*n2 n1/gcd(n1,n2)*n2 n1/gcd(n1,n2) n1 gcd(n1,n2) gcd n1 n2 n2 n1 n1 n2 n2 while True:
    try:
        a,b=[int(i) for i in input().split()]
        print("{} {}".format(int(gcd(a,b)),int(lcm(a,b))))
    except:
        break True try:
        a,b=[int(i) for i in input().split()]
        print("{} {}".format(int(gcd(a,b)),int(lcm(a,b))))
    except:
        break except:
        break break int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i a,b=[int(i) for i in input().split()] a [int(i) for i in input().split()] b print("{} {}".format(int(gcd(a,b)),int(lcm(a,b)))) print "{} {}".format(int(gcd(a,b)),int(lcm(a,b))) "{} {}".format "{} {}" format int(gcd(a,b)) int gcd(a,b) gcd a b int(lcm(a,b)) int lcm(a,b) lcm a b def gcd(n1,n2):
    if n2==0:
        return n1
    return gcd(n2,n1%n2) def gcd(n1,n2):
    if n2==0:
        return n1
    return gcd(n2,n1%n2) gcd def lcm(n1,n2):
    return n1/gcd(n1,n2)*n2 def lcm(n1,n2):
    return n1/gcd(n1,n2)*n2 lcm a,b=[int(i) for i in input().split()] [int(i) for i in input().split()] a b=[int(i) for i in input().split()] [int(i) for i in input().split()] b
def gcd(n1,n2):
    if n2==0:
        return n1
    return gcd(n2,n1%n2)

def lcm(n1,n2):
    return n1/gcd(n1,n2)*n2

while True:
    try:
        a,b=[int(i) for i in input().split()]
        print("{} {}".format(int(gcd(a,b)),int(lcm(a,b))))
    except:
        break
