import sys
dataset = sys.stdin.readlines()


def gcd(a, b):
    if b > a: return gcd(b, a)
    if a % b == 0: return b
    return gcd(b, a % b)

def lcd(a, b):
    return a * b // gcd(a, b)

for item in dataset:
    a, b = list(map(int, item.split()))
    print(gcd(a, b), lcd(a,b)) import sys sys dataset = sys.stdin.readlines() dataset sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines def gcd(a, b):
    if b > a: return gcd(b, a)
    if a % b == 0: return b
    return gcd(b, a % b) gcd if b > a: return gcd(b, a)
     b > a b a if a % b == 0: return b
     a % b == 0 a % b a b 0 return gcd(b, a % b) gcd(b, a % b) gcd b a % b a b a a b b def lcd(a, b):
    return a * b // gcd(a, b) lcd return a * b // gcd(a, b) a * b // gcd(a, b) a * b a b gcd(a, b) gcd a b a a b b for item in dataset:
    a, b = list(map(int, item.split()))
    print(gcd(a, b), lcd(a,b)) item dataset a, b = list(map(int, item.split())) a list(map(int, item.split())) list map(int, item.split()) map int item.split() item.split item split b print(gcd(a, b), lcd(a,b)) print gcd(a, b) gcd a b lcd(a,b) lcd a b def lcd(a, b):
    return a * b // gcd(a, b) def lcd(a, b):
    return a * b // gcd(a, b) lcd dataset = sys.stdin.readlines() sys.stdin.readlines() dataset a, b = list(map(int, item.split())) list(map(int, item.split())) a b = list(map(int, item.split())) list(map(int, item.split())) b def gcd(a, b):
    if b > a: return gcd(b, a)
    if a % b == 0: return b
    return gcd(b, a % b) def gcd(a, b):
    if b > a: return gcd(b, a)
    if a % b == 0: return b
    return gcd(b, a % b) gcd
import sys
dataset = sys.stdin.readlines()


def gcd(a, b):
    if b > a: return gcd(b, a)
    if a % b == 0: return b
    return gcd(b, a % b)

def lcd(a, b):
    return a * b // gcd(a, b)

for item in dataset:
    a, b = list(map(int, item.split()))
    print(gcd(a, b), lcd(a,b))