# coding=utf-8


def solve_gcd(number1: int, number2: int) -> int:
    two_list = [number1, number2]
    two_list.sort()
    if two_list[1] % two_list[0] == 0:
        return two_list[0]
    r = two_list[1] % two_list[0]
    return solve_gcd(two_list[0], r)


def solve_lcm(number1: int, number2: int, number3: int) -> int:
    return number1*number2//number3


if __name__ == '__main__':
    while True:
        try:
            a, b = map(int, input().split())
        except EOFError:
            break
        gcd = solve_gcd(a, b)
        lcm = solve_lcm(a, b, gcd)
        print(gcd, lcm) def solve_gcd(number1: int, number2: int) -> int:
    two_list = [number1, number2]
    two_list.sort()
    if two_list[1] % two_list[0] == 0:
        return two_list[0]
    r = two_list[1] % two_list[0]
    return solve_gcd(two_list[0], r) solve_gcd two_list = [number1, number2] two_list [number1, number2] number1 number2 two_list.sort() two_list.sort two_list sort if two_list[1] % two_list[0] == 0:
        return two_list[0]
     two_list[1] % two_list[0] == 0 two_list[1] % two_list[0] two_list[1] two_list 1 two_list[0] two_list 0 0 return two_list[0] two_list[0] two_list 0 r = two_list[1] % two_list[0] r two_list[1] % two_list[0] two_list[1] two_list 1 two_list[0] two_list 0 return solve_gcd(two_list[0], r) solve_gcd(two_list[0], r) solve_gcd two_list[0] two_list 0 r number1: int number1 number2: int number2 def solve_lcm(number1: int, number2: int, number3: int) -> int:
    return number1*number2//number3 solve_lcm return number1*number2//number3 number1*number2//number3 number1*number2 number1 number2 number3 number1: int number1 number2: int number2 number3: int number3 if __name__ == '__main__':
    while True:
        try:
            a, b = map(int, input().split())
        except EOFError:
            break
        gcd = solve_gcd(a, b)
        lcm = solve_lcm(a, b, gcd)
        print(gcd, lcm) __name__ == '__main__' __name__ '__main__' while True:
        try:
            a, b = map(int, input().split())
        except EOFError:
            break
        gcd = solve_gcd(a, b)
        lcm = solve_lcm(a, b, gcd)
        print(gcd, lcm) True try:
            a, b = map(int, input().split())
        except EOFError:
            break
         except EOFError:
            break
         break a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b gcd = solve_gcd(a, b) gcd solve_gcd(a, b) solve_gcd a b lcm = solve_lcm(a, b, gcd) lcm solve_lcm(a, b, gcd) solve_lcm a b gcd print(gcd, lcm) print gcd lcm gcd = solve_gcd(a, b) solve_gcd(a, b) gcd def solve_gcd(number1: int, number2: int) -> int:
    two_list = [number1, number2]
    two_list.sort()
    if two_list[1] % two_list[0] == 0:
        return two_list[0]
    r = two_list[1] % two_list[0]
    return solve_gcd(two_list[0], r) def solve_gcd(number1: int, number2: int) -> int:
    two_list = [number1, number2]
    two_list.sort()
    if two_list[1] % two_list[0] == 0:
        return two_list[0]
    r = two_list[1] % two_list[0]
    return solve_gcd(two_list[0], r) solve_gcd lcm = solve_lcm(a, b, gcd) solve_lcm(a, b, gcd) lcm def solve_lcm(number1: int, number2: int, number3: int) -> int:
    return number1*number2//number3 def solve_lcm(number1: int, number2: int, number3: int) -> int:
    return number1*number2//number3 solve_lcm a, b = map(int, input().split()) map(int, input().split()) a b = map(int, input().split()) map(int, input().split()) b
# coding=utf-8


def solve_gcd(number1: int, number2: int) -> int:
    two_list = [number1, number2]
    two_list.sort()
    if two_list[1] % two_list[0] == 0:
        return two_list[0]
    r = two_list[1] % two_list[0]
    return solve_gcd(two_list[0], r)


def solve_lcm(number1: int, number2: int, number3: int) -> int:
    return number1*number2//number3


if __name__ == '__main__':
    while True:
        try:
            a, b = map(int, input().split())
        except EOFError:
            break
        gcd = solve_gcd(a, b)
        lcm = solve_lcm(a, b, gcd)
        print(gcd, lcm)