#coding:utf-8

import sys

def gcd(n):
    x = n[0]
    y = n[1]

    while y:
        x, y = y, x % y

    return x


def lcm(n):
    return int(n[0] * n[1] / gcd(n))


if __name__ == '__main__':

    lines = []

    for line in sys.stdin:
        if line == "\n":
            break
        else :
            lines.append([int(item) for item in line.split(" ")])

    for n in lines:
        print(str(gcd(n)) + " " + str(lcm(n)))  import sys sys def gcd(n):
    x = n[0]
    y = n[1]

    while y:
        x, y = y, x % y

    return x gcd x = n[0] x n[0] n 0 y = n[1] y n[1] n 1 while y:
        x, y = y, x % y

     y x, y = y, x % y x y y x % y x y return x x n n def lcm(n):
    return int(n[0] * n[1] / gcd(n)) lcm return int(n[0] * n[1] / gcd(n)) int(n[0] * n[1] / gcd(n)) int n[0] * n[1] / gcd(n) n[0] * n[1] n[0] n 0 n[1] n 1 gcd(n) gcd n n n if __name__ == '__main__':

    lines = []

    for line in sys.stdin:
        if line == "\n":
            break
        else :
            lines.append([int(item) for item in line.split(" ")])

    for n in lines:
        print(str(gcd(n)) + " " + str(lcm(n)))  __name__ == '__main__' __name__ '__main__' lines = [] lines [] for line in sys.stdin:
        if line == "\n":
            break
        else :
            lines.append([int(item) for item in line.split(" ")])

     line sys.stdin sys stdin if line == "\n":
            break
        else :
            lines.append([int(item) for item in line.split(" ")])

     line == "\n" line "\n" break int(item) for item in line.split(" ") for item in line.split(" ") item line.split(" ") line.split line split " " for item in line.split(" ") int(item) int item lines.append([int(item) for item in line.split(" ")]) lines.append lines append [int(item) for item in line.split(" ")] for n in lines:
        print(str(gcd(n)) + " " + str(lcm(n)))  n lines print(str(gcd(n)) + " " + str(lcm(n))) print str(gcd(n)) + " " + str(lcm(n)) str(gcd(n)) + " " str(gcd(n)) str gcd(n) gcd n " " str(lcm(n)) str lcm(n) lcm n def gcd(n):
    x = n[0]
    y = n[1]

    while y:
        x, y = y, x % y

    return x def gcd(n):
    x = n[0]
    y = n[1]

    while y:
        x, y = y, x % y

    return x gcd lines = [] [] lines def lcm(n):
    return int(n[0] * n[1] / gcd(n)) def lcm(n):
    return int(n[0] * n[1] / gcd(n)) lcm
#coding:utf-8

import sys

def gcd(n):
    x = n[0]
    y = n[1]

    while y:
        x, y = y, x % y

    return x


def lcm(n):
    return int(n[0] * n[1] / gcd(n))


if __name__ == '__main__':

    lines = []

    for line in sys.stdin:
        if line == "\n":
            break
        else :
            lines.append([int(item) for item in line.split(" ")])

    for n in lines:
        print(str(gcd(n)) + " " + str(lcm(n))) 