import math

while True:
    try:
        a, b = [int(i) for i in input().split()]

        gcd = math.gcd(a, b)
        lcm = a * b // gcd

        print(f'{gcd} {lcm}')
    except EOFError:
        break
 import math math while True:
    try:
        a, b = [int(i) for i in input().split()]

        gcd = math.gcd(a, b)
        lcm = a * b // gcd

        print(f'{gcd} {lcm}')
    except EOFError:
        break True try:
        a, b = [int(i) for i in input().split()]

        gcd = math.gcd(a, b)
        lcm = a * b // gcd

        print(f'{gcd} {lcm}')
    except EOFError:
        break except EOFError:
        break break int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i a, b = [int(i) for i in input().split()] a [int(i) for i in input().split()] b gcd = math.gcd(a, b) gcd math.gcd(a, b) math.gcd math gcd a b lcm = a * b // gcd lcm a * b // gcd a * b a b gcd print(f'{gcd} {lcm}') print f'{gcd} {lcm}' a, b = [int(i) for i in input().split()] [int(i) for i in input().split()] a lcm = a * b // gcd a * b // gcd lcm b = [int(i) for i in input().split()] [int(i) for i in input().split()] b gcd = math.gcd(a, b) math.gcd(a, b) gcd
import math

while True:
    try:
        a, b = [int(i) for i in input().split()]

        gcd = math.gcd(a, b)
        lcm = a * b // gcd

        print(f'{gcd} {lcm}')
    except EOFError:
        break

