import sys
def gcd(a,b):
    if a<b:
        t = a
        a = b
        b = t
    while b != 0:
        temp = b
        b = a%b
        a = temp
    return a

for i in sys.stdin:
    a,b = map(int, i.split())
    g = gcd(a,b)
    print(g, a*b//g) import sys sys def gcd(a,b):
    if a<b:
        t = a
        a = b
        b = t
    while b != 0:
        temp = b
        b = a%b
        a = temp
    return a gcd if a<b:
        t = a
        a = b
        b = t
     a<b a b t = a t a a = b a b b = t b t while b != 0:
        temp = b
        b = a%b
        a = temp
     b != 0 b 0 temp = b temp b b = a%b b a%b a b a = temp a temp return a a a a b b for i in sys.stdin:
    a,b = map(int, i.split())
    g = gcd(a,b)
    print(g, a*b//g) i sys.stdin sys stdin a,b = map(int, i.split()) a map(int, i.split()) map int i.split() i.split i split b g = gcd(a,b) g gcd(a,b) gcd a b print(g, a*b//g) print g a*b//g a*b a b g def gcd(a,b):
    if a<b:
        t = a
        a = b
        b = t
    while b != 0:
        temp = b
        b = a%b
        a = temp
    return a def gcd(a,b):
    if a<b:
        t = a
        a = b
        b = t
    while b != 0:
        temp = b
        b = a%b
        a = temp
    return a gcd a,b = map(int, i.split()) map(int, i.split()) a b = map(int, i.split()) map(int, i.split()) b g = gcd(a,b) gcd(a,b) g
import sys
def gcd(a,b):
    if a<b:
        t = a
        a = b
        b = t
    while b != 0:
        temp = b
        b = a%b
        a = temp
    return a

for i in sys.stdin:
    a,b = map(int, i.split())
    g = gcd(a,b)
    print(g, a*b//g)