def pd(n):
    i = 2
    ans = []
    while i ** 2 <= n:
        while n % i == 0:
            n /= i
            ans.append(i)
        i += 1
    if n > 1:
        ans.append(n)
    return ans

def gcd(a, b):
    gcd = 1
    pd_a = pd(a)
    pd_b = pd(b)
    for i in pd_a:
        if i in pd_b:
            pd_b.remove(i)
            gcd *= i
    return int(gcd)

def lcm(a, b):
    lcm = a
    pd_a = pd(a)
    pd_b = pd(b)
    for i in pd_a:
        if i in pd_b:
            pd_b.remove(i)
    for j in pd_b:
        lcm *= j
    return int(lcm)

while True:
    try:
        s = input()
        a,b = [int(i) for i in s.split(' ')]
    except:
        break
    print(gcd(a, b), lcm(a, b)) def pd(n):
    i = 2
    ans = []
    while i ** 2 <= n:
        while n % i == 0:
            n /= i
            ans.append(i)
        i += 1
    if n > 1:
        ans.append(n)
    return ans pd i = 2 i 2 ans = [] ans [] while i ** 2 <= n:
        while n % i == 0:
            n /= i
            ans.append(i)
        i += 1
     i ** 2 <= n i ** 2 i 2 n while n % i == 0:
            n /= i
            ans.append(i)
         n % i == 0 n % i n i 0 n /= i n i ans.append(i) ans.append ans append i i += 1 i 1 if n > 1:
        ans.append(n)
     n > 1 n 1 ans.append(n) ans.append ans append n return ans ans n n def gcd(a, b):
    gcd = 1
    pd_a = pd(a)
    pd_b = pd(b)
    for i in pd_a:
        if i in pd_b:
            pd_b.remove(i)
            gcd *= i
    return int(gcd) gcd gcd = 1 gcd 1 pd_a = pd(a) pd_a pd(a) pd a pd_b = pd(b) pd_b pd(b) pd b for i in pd_a:
        if i in pd_b:
            pd_b.remove(i)
            gcd *= i
     i pd_a if i in pd_b:
            pd_b.remove(i)
            gcd *= i
     i in pd_b i pd_b pd_b.remove(i) pd_b.remove pd_b remove i gcd *= i gcd i return int(gcd) int(gcd) int gcd a a b b def lcm(a, b):
    lcm = a
    pd_a = pd(a)
    pd_b = pd(b)
    for i in pd_a:
        if i in pd_b:
            pd_b.remove(i)
    for j in pd_b:
        lcm *= j
    return int(lcm) lcm lcm = a lcm a pd_a = pd(a) pd_a pd(a) pd a pd_b = pd(b) pd_b pd(b) pd b for i in pd_a:
        if i in pd_b:
            pd_b.remove(i)
     i pd_a if i in pd_b:
            pd_b.remove(i)
     i in pd_b i pd_b pd_b.remove(i) pd_b.remove pd_b remove i for j in pd_b:
        lcm *= j
     j pd_b lcm *= j lcm j return int(lcm) int(lcm) int lcm a a b b while True:
    try:
        s = input()
        a,b = [int(i) for i in s.split(' ')]
    except:
        break
    print(gcd(a, b), lcm(a, b)) True try:
        s = input()
        a,b = [int(i) for i in s.split(' ')]
    except:
        break
     except:
        break
     break s = input() s input() input int(i) for i in s.split(' ') for i in s.split(' ') i s.split(' ') s.split s split ' ' for i in s.split(' ') int(i) int i a,b = [int(i) for i in s.split(' ')] a [int(i) for i in s.split(' ')] b print(gcd(a, b), lcm(a, b)) print gcd(a, b) gcd a b lcm(a, b) lcm a b s = input() input() s a,b = [int(i) for i in s.split(' ')] [int(i) for i in s.split(' ')] a def lcm(a, b):
    lcm = a
    pd_a = pd(a)
    pd_b = pd(b)
    for i in pd_a:
        if i in pd_b:
            pd_b.remove(i)
    for j in pd_b:
        lcm *= j
    return int(lcm) def lcm(a, b):
    lcm = a
    pd_a = pd(a)
    pd_b = pd(b)
    for i in pd_a:
        if i in pd_b:
            pd_b.remove(i)
    for j in pd_b:
        lcm *= j
    return int(lcm) lcm b = [int(i) for i in s.split(' ')] [int(i) for i in s.split(' ')] b def gcd(a, b):
    gcd = 1
    pd_a = pd(a)
    pd_b = pd(b)
    for i in pd_a:
        if i in pd_b:
            pd_b.remove(i)
            gcd *= i
    return int(gcd) def gcd(a, b):
    gcd = 1
    pd_a = pd(a)
    pd_b = pd(b)
    for i in pd_a:
        if i in pd_b:
            pd_b.remove(i)
            gcd *= i
    return int(gcd) gcd def pd(n):
    i = 2
    ans = []
    while i ** 2 <= n:
        while n % i == 0:
            n /= i
            ans.append(i)
        i += 1
    if n > 1:
        ans.append(n)
    return ans def pd(n):
    i = 2
    ans = []
    while i ** 2 <= n:
        while n % i == 0:
            n /= i
            ans.append(i)
        i += 1
    if n > 1:
        ans.append(n)
    return ans pd
def pd(n):
    i = 2
    ans = []
    while i ** 2 <= n:
        while n % i == 0:
            n /= i
            ans.append(i)
        i += 1
    if n > 1:
        ans.append(n)
    return ans

def gcd(a, b):
    gcd = 1
    pd_a = pd(a)
    pd_b = pd(b)
    for i in pd_a:
        if i in pd_b:
            pd_b.remove(i)
            gcd *= i
    return int(gcd)

def lcm(a, b):
    lcm = a
    pd_a = pd(a)
    pd_b = pd(b)
    for i in pd_a:
        if i in pd_b:
            pd_b.remove(i)
    for j in pd_b:
        lcm *= j
    return int(lcm)

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