# -*- coding: utf-8 -*-
while True:
    try:
        list = [int(x) for x in raw_input().split(" ")]
        list.sort(lambda x, y: y - x)
        gcd = lcm = 0
        m = list[0]
        n = list[1]
        while True:
            r = m%n
            if r == 0:
                gcd = n
                break
            m = n
            n = r
        lcm = list[0] * list[1] / gcd
        print(str(gcd) + " " + str(lcm))
    except EOFError:
        break while True:
    try:
        list = [int(x) for x in raw_input().split(" ")]
        list.sort(lambda x, y: y - x)
        gcd = lcm = 0
        m = list[0]
        n = list[1]
        while True:
            r = m%n
            if r == 0:
                gcd = n
                break
            m = n
            n = r
        lcm = list[0] * list[1] / gcd
        print(str(gcd) + " " + str(lcm))
    except EOFError:
        break True try:
        list = [int(x) for x in raw_input().split(" ")]
        list.sort(lambda x, y: y - x)
        gcd = lcm = 0
        m = list[0]
        n = list[1]
        while True:
            r = m%n
            if r == 0:
                gcd = n
                break
            m = n
            n = r
        lcm = list[0] * list[1] / gcd
        print(str(gcd) + " " + str(lcm))
    except EOFError:
        break except EOFError:
        break break int(x) for x in raw_input().split(" ") for x in raw_input().split(" ") x raw_input().split(" ") ().split () raw_input split " " for x in raw_input().split(" ") int(x) int x list = [int(x) for x in raw_input().split(" ")] list [int(x) for x in raw_input().split(" ")] list.sort(lambda x, y: y - x) list.sort list sort lambda x, y: y - x y - x y x x y gcd = lcm = 0 gcd 0 = lcm = 0 lcm 0 m = list[0] m list[0] list 0 n = list[1] n list[1] list 1 while True:
            r = m%n
            if r == 0:
                gcd = n
                break
            m = n
            n = r
         True r = m%n r m%n m n if r == 0:
                gcd = n
                break
             r == 0 r 0 gcd = n gcd n break m = n m n n = r n r lcm = list[0] * list[1] / gcd lcm list[0] * list[1] / gcd list[0] * list[1] list[0] list 0 list[1] list 1 gcd print(str(gcd) + " " + str(lcm)) print str(gcd) + " " + str(lcm) str(gcd) + " " str(gcd) str gcd " " str(lcm) str lcm n = r r n n = list[1] list[1] n list = [int(x) for x in raw_input().split(" ")] [int(x) for x in raw_input().split(" ")] list gcd = n n gcd m = n n m lcm = 0 0 lcm r = m%n m%n r m = list[0] list[0] m gcd = lcm = 0 0 gcd lcm = list[0] * list[1] / gcd list[0] * list[1] / gcd lcm
# -*- coding: utf-8 -*-
while True:
    try:
        list = [int(x) for x in raw_input().split(" ")]
        list.sort(lambda x, y: y - x)
        gcd = lcm = 0
        m = list[0]
        n = list[1]
        while True:
            r = m%n
            if r == 0:
                gcd = n
                break
            m = n
            n = r
        lcm = list[0] * list[1] / gcd
        print(str(gcd) + " " + str(lcm))
    except EOFError:
        break