def gcd(a,b):
    if b==0:
        return a
    return gcd(b,a%b)
def lcm(a,b,g):
    return a*b/g

while 1:
    try:
        a,b=map(int,raw_input().split())
        g=gcd(a,b)
        print g,lcm(a,b,g)
    except:
        break def gcd(a,b):
    if b==0:
        return a
    return gcd(b,a%b) gcd if b==0:
        return a
     b==0 b 0 return a a return gcd(b,a%b) gcd(b,a%b) gcd b a%b a b a a b b def lcm(a,b,g):
    return a*b/g lcm return a*b/g a*b/g a*b a b g a a b b g g while 1:
    try:
        a,b=map(int,raw_input().split())
        g=gcd(a,b)
        print g,lcm(a,b,g)
    except:
        break 1 try:
        a,b=map(int,raw_input().split())
        g=gcd(a,b)
        print g,lcm(a,b,g)
    except:
        break except:
        break break a,b=map(int,raw_input().split()) a map(int,raw_input().split()) map int raw_input().split() ().split () raw_input split b g=gcd(a,b) g gcd(a,b) gcd a b print g lcm(a,b,g) lcm a b g a,b=map(int,raw_input().split()) map(int,raw_input().split()) a g=gcd(a,b) gcd(a,b) g def gcd(a,b):
    if b==0:
        return a
    return gcd(b,a%b) def gcd(a,b):
    if b==0:
        return a
    return gcd(b,a%b) gcd b=map(int,raw_input().split()) map(int,raw_input().split()) b def lcm(a,b,g):
    return a*b/g def lcm(a,b,g):
    return a*b/g lcm
def gcd(a,b):
    if b==0:
        return a
    return gcd(b,a%b)
def lcm(a,b,g):
    return a*b/g

while 1:
    try:
        a,b=map(int,raw_input().split())
        g=gcd(a,b)
        print g,lcm(a,b,g)
    except:
        break