# -*- coding: utf-8 -*-

import sys

def isprime(n):
    for i in xrange(2, int(n ** 0.5)+1 ):
        if n % i == 0: return False
    return True


outList = []
for line in sys.stdin.readlines():
    List = map(int, line.strip().split())

    [a, b] = List

    # LCM
    LCM = 1
    i = 1
    while( i <= min(a, b) ):
        i += 1
        if not isprime(i): continue
        while(a % i == 0 and b % i == 0):
            LCM *= i
            a /= i
            b /= i

    # GCD
    GCD = List[0] * b

    print LCM, GCD import sys sys def isprime(n):
    for i in xrange(2, int(n ** 0.5)+1 ):
        if n % i == 0: return False
    return True isprime for i in xrange(2, int(n ** 0.5)+1 ):
        if n % i == 0: return False
     i xrange(2, int(n ** 0.5)+1 ) xrange 2 int(n ** 0.5)+1 int(n ** 0.5) int n ** 0.5 n 0.5 1 if n % i == 0: return False
     n % i == 0 n % i n i 0 return True True n n outList = [] outList [] for line in sys.stdin.readlines():
    List = map(int, line.strip().split())

    [a, b] = List

    # LCM
    LCM = 1
    i = 1
    while( i <= min(a, b) ):
        i += 1
        if not isprime(i): continue
        while(a % i == 0 and b % i == 0):
            LCM *= i
            a /= i
            b /= i

    # GCD
    GCD = List[0] * b

    print LCM, GCD line sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines List = map(int, line.strip().split()) List map(int, line.strip().split()) map int line.strip().split() line.strip().split line.strip() line.strip line strip split [a, b] = List [a, b] a b List LCM = 1 LCM 1 i = 1 i 1 while( i <= min(a, b) ):
        i += 1
        if not isprime(i): continue
        while(a % i == 0 and b % i == 0):
            LCM *= i
            a /= i
            b /= i

    # GCD
     i <= min(a, b) i min(a, b) min a b i += 1 i 1 if not isprime(i): continue
         not isprime(i) isprime(i) isprime i while(a % i == 0 and b % i == 0):
            LCM *= i
            a /= i
            b /= i

    # GCD
     a % i == 0 and b % i == 0 a % i == 0 a % i a i 0 b % i == 0 b % i b i 0 LCM *= i LCM i a /= i a i b /= i b i GCD = List[0] * b GCD List[0] * b List[0] List 0 b print LCM GCD def isprime(n):
    for i in xrange(2, int(n ** 0.5)+1 ):
        if n % i == 0: return False
    return True def isprime(n):
    for i in xrange(2, int(n ** 0.5)+1 ):
        if n % i == 0: return False
    return True isprime LCM = 1 1 LCM LCM *= i i LCM b /= i i b outList = [] [] outList List = map(int, line.strip().split()) map(int, line.strip().split()) List i += 1 1 i a /= i i a i = 1 1 i GCD = List[0] * b List[0] * b GCD
# -*- coding: utf-8 -*-

import sys

def isprime(n):
    for i in xrange(2, int(n ** 0.5)+1 ):
        if n % i == 0: return False
    return True


outList = []
for line in sys.stdin.readlines():
    List = map(int, line.strip().split())

    [a, b] = List

    # LCM
    LCM = 1
    i = 1
    while( i <= min(a, b) ):
        i += 1
        if not isprime(i): continue
        while(a % i == 0 and b % i == 0):
            LCM *= i
            a /= i
            b /= i

    # GCD
    GCD = List[0] * b

    print LCM, GCD