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

while True:
    try:
        a, b = map(int, input().split())
    except EOFError:
        break
    else:
        g = gcd(a,b)
        print(g, a*b//g) def gcd(a, b):
    if a == 0 or b == 0:
        return 0
    while b != 0:
        a, b = b, a%b
    return a gcd if a == 0 or b == 0:
        return 0
     a == 0 or b == 0 a == 0 a 0 b == 0 b 0 return 0 0 while b != 0:
        a, b = b, a%b
     b != 0 b 0 a, b = b, a%b a b b a%b a b return a a a a b b while True:
    try:
        a, b = map(int, input().split())
    except EOFError:
        break
    else:
        g = gcd(a,b)
        print(g, a*b//g) True try:
        a, b = map(int, input().split())
    except EOFError:
        break
    else:
        g = gcd(a,b)
        print(g, a*b//g) except EOFError:
        break
     break a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b g = gcd(a,b) g gcd(a,b) gcd a b print(g, a*b//g) print g a*b//g a*b a b g a, b = map(int, input().split()) map(int, input().split()) a def gcd(a, b):
    if a == 0 or b == 0:
        return 0
    while b != 0:
        a, b = b, a%b
    return a def gcd(a, b):
    if a == 0 or b == 0:
        return 0
    while b != 0:
        a, b = b, a%b
    return a gcd g = gcd(a,b) gcd(a,b) g b = map(int, input().split()) map(int, input().split()) b
def gcd(a, b):
    if a == 0 or b == 0:
        return 0
    while b != 0:
        a, b = b, a%b
    return a

while True:
    try:
        a, b = map(int, input().split())
    except EOFError:
        break
    else:
        g = gcd(a,b)
        print(g, a*b//g)