def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x%y)


def lcm(x,y):
    return x/gcd(x, y)*y


while True:
    try:
        x, y = map(int, raw_input().split())
    except EOFError:
        break

    print "%d %d" % (gcd(x, y), lcm(x, y)) def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x%y) gcd if y == 0:
        return x
    else:
        return gcd(y, x%y) y == 0 y 0 return x x return gcd(y, x%y) gcd(y, x%y) gcd y x%y x y x x y y def lcm(x,y):
    return x/gcd(x, y)*y lcm return x/gcd(x, y)*y x/gcd(x, y)*y x/gcd(x, y) x gcd(x, y) gcd x y y x x y y while True:
    try:
        x, y = map(int, raw_input().split())
    except EOFError:
        break

    print "%d %d" % (gcd(x, y), lcm(x, y)) True try:
        x, y = map(int, raw_input().split())
    except EOFError:
        break

     except EOFError:
        break

     break x, y = map(int, raw_input().split()) x map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split y print "%d %d" % (gcd(x, y), lcm(x, y)) "%d %d" (gcd(x, y), lcm(x, y)) gcd(x, y) gcd x y lcm(x, y) lcm x y x, y = map(int, raw_input().split()) map(int, raw_input().split()) x y = map(int, raw_input().split()) map(int, raw_input().split()) y def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x%y) def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x%y) gcd def lcm(x,y):
    return x/gcd(x, y)*y def lcm(x,y):
    return x/gcd(x, y)*y lcm
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x%y)


def lcm(x,y):
    return x/gcd(x, y)*y


while True:
    try:
        x, y = map(int, raw_input().split())
    except EOFError:
        break

    print "%d %d" % (gcd(x, y), lcm(x, y))