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

import sys
import os

def gcd(a, b):
    # big - small
    while a != b:
        if a > b:
            a, b = b, a
        a, b = b - a, a
    return a

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

lst = sys.stdin.readlines()
for s in lst:
    a, b = map(int, s.split())
    G = gcd(a, b)
    L = lcm(a, b)
    print(G, L) import sys sys import os os def gcd(a, b):
    # big - small
    while a != b:
        if a > b:
            a, b = b, a
        a, b = b - a, a
    return a gcd while a != b:
        if a > b:
            a, b = b, a
        a, b = b - a, a
     a != b a b if a > b:
            a, b = b, a
         a > b a b a, b = b, a a b b a a, b = b - a, a a b - a b a b a return a a a a b b def lcm(a, b):
    return a * b // gcd(a, b) lcm 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 lst = sys.stdin.readlines() lst sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines for s in lst:
    a, b = map(int, s.split())
    G = gcd(a, b)
    L = lcm(a, b)
    print(G, L) s lst a, b = map(int, s.split()) a map(int, s.split()) map int s.split() s.split s split b G = gcd(a, b) G gcd(a, b) gcd a b L = lcm(a, b) L lcm(a, b) lcm a b print(G, L) print G L L = lcm(a, b) lcm(a, b) L b = map(int, s.split()) map(int, s.split()) b G = gcd(a, b) gcd(a, b) G lst = sys.stdin.readlines() sys.stdin.readlines() lst def lcm(a, b):
    return a * b // gcd(a, b) def lcm(a, b):
    return a * b // gcd(a, b) lcm def gcd(a, b):
    # big - small
    while a != b:
        if a > b:
            a, b = b, a
        a, b = b - a, a
    return a def gcd(a, b):
    # big - small
    while a != b:
        if a > b:
            a, b = b, a
        a, b = b - a, a
    return a gcd a, b = map(int, s.split()) map(int, s.split()) a
# -*- coding: utf-8 -*-

import sys
import os

def gcd(a, b):
    # big - small
    while a != b:
        if a > b:
            a, b = b, a
        a, b = b - a, a
    return a

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

lst = sys.stdin.readlines()
for s in lst:
    a, b = map(int, s.split())
    G = gcd(a, b)
    L = lcm(a, b)
    print(G, L)