def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = list(get_input())
for l in range(len(N)):
    a,b = [int(i) for i in N[l].split()]
    A = a
    B = b
    if(a<b):
        c = a
        a = b
        b = c

    while b > 0:
        nexta = b
        nextb = a % b
        a = nexta
        b = nextb

    g = a
    print(g, int(A*B/g))
 def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break get_input while True:
        try:
            yield ''.join(input())
        except EOFError:
            break True try:
            yield ''.join(input())
        except EOFError:
            break except EOFError:
            break break yield ''.join(input()) ''.join(input()) ''.join '' join input() input N = list(get_input()) N list(get_input()) list get_input() get_input for l in range(len(N)):
    a,b = [int(i) for i in N[l].split()]
    A = a
    B = b
    if(a<b):
        c = a
        a = b
        b = c

    while b > 0:
        nexta = b
        nextb = a % b
        a = nexta
        b = nextb

    g = a
    print(g, int(A*B/g)) l range(len(N)) range len(N) len N int(i) for i in N[l].split() for i in N[l].split() i N[l].split() [l].split [l] N l split for i in N[l].split() int(i) int i a,b = [int(i) for i in N[l].split()] a [int(i) for i in N[l].split()] b A = a A a B = b B b if(a<b):
        c = a
        a = b
        b = c

     a<b a b c = a c a a = b a b b = c b c while b > 0:
        nexta = b
        nextb = a % b
        a = nexta
        b = nextb

     b > 0 b 0 nexta = b nexta b nextb = a % b nextb a % b a b a = nexta a nexta b = nextb b nextb g = a g a print(g, int(A*B/g)) print g int(A*B/g) int A*B/g A*B A B g B = b b B b = c c b N = list(get_input()) list(get_input()) N c = a a c def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break get_input g = a a g nextb = a % b a % b nextb nexta = b b nexta b = [int(i) for i in N[l].split()] [int(i) for i in N[l].split()] b A = a a A b = nextb nextb b a,b = [int(i) for i in N[l].split()] [int(i) for i in N[l].split()] a a = b b a a = nexta nexta a
def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = list(get_input())
for l in range(len(N)):
    a,b = [int(i) for i in N[l].split()]
    A = a
    B = b
    if(a<b):
        c = a
        a = b
        b = c

    while b > 0:
        nexta = b
        nextb = a % b
        a = nexta
        b = nextb

    g = a
    print(g, int(A*B/g))

