def gcd(a,b):
    while True:
        if a > b:
            a %= b
        else:
            b %= a
        if a == 0 or b == 0:
            return max(a,b)

def lcm(a,b,g):
    return int(a*b/g)
from sys import stdin
for l in stdin:
    a,b = list(map(int,l.split()))
    g = gcd(a,b)
    print ("%s %s"%(g,lcm(a,b,g))) def gcd(a,b):
    while True:
        if a > b:
            a %= b
        else:
            b %= a
        if a == 0 or b == 0:
            return max(a,b) gcd while True:
        if a > b:
            a %= b
        else:
            b %= a
        if a == 0 or b == 0:
            return max(a,b) True if a > b:
            a %= b
        else:
            b %= a
         a > b a b a %= b a b b %= a b a if a == 0 or b == 0:
            return max(a,b) a == 0 or b == 0 a == 0 a 0 b == 0 b 0 return max(a,b) max(a,b) max a b a a b b def lcm(a,b,g):
    return int(a*b/g) lcm return int(a*b/g) int(a*b/g) int a*b/g a*b a b g a a b b g g from sys import stdin for l in stdin:
    a,b = list(map(int,l.split()))
    g = gcd(a,b)
    print ("%s %s"%(g,lcm(a,b,g))) l stdin a,b = list(map(int,l.split())) a list(map(int,l.split())) list map(int,l.split()) map int l.split() l.split l split b g = gcd(a,b) g gcd(a,b) gcd a b print ("%s %s"%(g,lcm(a,b,g))) print "%s %s"%(g,lcm(a,b,g)) "%s %s" (g,lcm(a,b,g)) g lcm(a,b,g) lcm a b g g = gcd(a,b) gcd(a,b) g def lcm(a,b,g):
    return int(a*b/g) def lcm(a,b,g):
    return int(a*b/g) lcm b = list(map(int,l.split())) list(map(int,l.split())) b a,b = list(map(int,l.split())) list(map(int,l.split())) a def gcd(a,b):
    while True:
        if a > b:
            a %= b
        else:
            b %= a
        if a == 0 or b == 0:
            return max(a,b) def gcd(a,b):
    while True:
        if a > b:
            a %= b
        else:
            b %= a
        if a == 0 or b == 0:
            return max(a,b) gcd
def gcd(a,b):
    while True:
        if a > b:
            a %= b
        else:
            b %= a
        if a == 0 or b == 0:
            return max(a,b)

def lcm(a,b,g):
    return int(a*b/g)
from sys import stdin
for l in stdin:
    a,b = list(map(int,l.split()))
    g = gcd(a,b)
    print ("%s %s"%(g,lcm(a,b,g)))