import sys

def gcd(a,b):
    while a % b != 0:
        a, b = b, a % b
    return b

def lcm(a,b,g):
    _a = a // g
    _b = b // g
    return _a * _b * g

def run():
    data = []
    for n in sys.stdin:
        a, b = list(map(int, n.split()))
        data.append((a,b))

    for _data in data:
        a, b = _data
        g = gcd(a,b)
        l = lcm(a,b,g)
        print(g, l)

if __name__ == '__main__':
    run()

 import sys sys def gcd(a,b):
    while a % b != 0:
        a, b = b, a % b
    return b gcd while a % b != 0:
        a, b = b, a % b
     a % b != 0 a % b a b 0 a, b = b, a % b a b b a % b a b return b b a a b b def lcm(a,b,g):
    _a = a // g
    _b = b // g
    return _a * _b * g lcm _a = a // g _a a // g a g _b = b // g _b b // g b g return _a * _b * g _a * _b * g _a * _b _a _b g a a b b g g def run():
    data = []
    for n in sys.stdin:
        a, b = list(map(int, n.split()))
        data.append((a,b))

    for _data in data:
        a, b = _data
        g = gcd(a,b)
        l = lcm(a,b,g)
        print(g, l) run data = [] data [] for n in sys.stdin:
        a, b = list(map(int, n.split()))
        data.append((a,b))

     n sys.stdin sys stdin a, b = list(map(int, n.split())) a list(map(int, n.split())) list map(int, n.split()) map int n.split() n.split n split b data.append((a,b)) data.append data append (a,b) a b for _data in data:
        a, b = _data
        g = gcd(a,b)
        l = lcm(a,b,g)
        print(g, l) _data data a, b = _data a _data b g = gcd(a,b) g gcd(a,b) gcd a b l = lcm(a,b,g) l lcm(a,b,g) lcm a b g print(g, l) print g l if __name__ == '__main__':
    run() __name__ == '__main__' __name__ '__main__' run() run def run():
    data = []
    for n in sys.stdin:
        a, b = list(map(int, n.split()))
        data.append((a,b))

    for _data in data:
        a, b = _data
        g = gcd(a,b)
        l = lcm(a,b,g)
        print(g, l) def run():
    data = []
    for n in sys.stdin:
        a, b = list(map(int, n.split()))
        data.append((a,b))

    for _data in data:
        a, b = _data
        g = gcd(a,b)
        l = lcm(a,b,g)
        print(g, l) run def gcd(a,b):
    while a % b != 0:
        a, b = b, a % b
    return b def gcd(a,b):
    while a % b != 0:
        a, b = b, a % b
    return b gcd def lcm(a,b,g):
    _a = a // g
    _b = b // g
    return _a * _b * g def lcm(a,b,g):
    _a = a // g
    _b = b // g
    return _a * _b * g lcm
import sys

def gcd(a,b):
    while a % b != 0:
        a, b = b, a % b
    return b

def lcm(a,b,g):
    _a = a // g
    _b = b // g
    return _a * _b * g

def run():
    data = []
    for n in sys.stdin:
        a, b = list(map(int, n.split()))
        data.append((a,b))

    for _data in data:
        a, b = _data
        g = gcd(a,b)
        l = lcm(a,b,g)
        print(g, l)

if __name__ == '__main__':
    run()


