def gcd(a, b):
    if (a % b) == 0:
        return b
    return gcd(b, a%b)

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


while True:
    try:
        nums = list(map(int, input().split()))
        print(gcd(nums[0], nums[1]), lcd(nums[0], nums[1]))

    except EOFError:
        break def gcd(a, b):
    if (a % b) == 0:
        return b
    return gcd(b, a%b) gcd if (a % b) == 0:
        return b
     (a % b) == 0 a % b a b 0 return b b return gcd(b, a%b) gcd(b, a%b) gcd b a%b a b a a b b def lcd(a, b):
    return a * b // gcd(a, b) lcd 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 while True:
    try:
        nums = list(map(int, input().split()))
        print(gcd(nums[0], nums[1]), lcd(nums[0], nums[1]))

    except EOFError:
        break True try:
        nums = list(map(int, input().split()))
        print(gcd(nums[0], nums[1]), lcd(nums[0], nums[1]))

    except EOFError:
        break except EOFError:
        break break nums = list(map(int, input().split())) nums list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split print(gcd(nums[0], nums[1]), lcd(nums[0], nums[1])) print gcd(nums[0], nums[1]) gcd nums[0] nums 0 nums[1] nums 1 lcd(nums[0], nums[1]) lcd nums[0] nums 0 nums[1] nums 1 def gcd(a, b):
    if (a % b) == 0:
        return b
    return gcd(b, a%b) def gcd(a, b):
    if (a % b) == 0:
        return b
    return gcd(b, a%b) gcd nums = list(map(int, input().split())) list(map(int, input().split())) nums def lcd(a, b):
    return a * b // gcd(a, b) def lcd(a, b):
    return a * b // gcd(a, b) lcd
def gcd(a, b):
    if (a % b) == 0:
        return b
    return gcd(b, a%b)

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


while True:
    try:
        nums = list(map(int, input().split()))
        print(gcd(nums[0], nums[1]), lcd(nums[0], nums[1]))

    except EOFError:
        break