def gcd(a, b):
    if a % b == 0:
        return b
    else:
        return gcd(b, a % b)
while True:
    try:
        a, b = map(int, input().split())
        d = gcd(max(a, b), min(a, b))
        print(d, a * b // d)
    except:
        break def gcd(a, b):
    if a % b == 0:
        return b
    else:
        return gcd(b, a % b) gcd if a % b == 0:
        return b
    else:
        return gcd(b, a % 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 while True:
    try:
        a, b = map(int, input().split())
        d = gcd(max(a, b), min(a, b))
        print(d, a * b // d)
    except:
        break True try:
        a, b = map(int, input().split())
        d = gcd(max(a, b), min(a, b))
        print(d, a * b // d)
    except:
        break except:
        break break a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b d = gcd(max(a, b), min(a, b)) d gcd(max(a, b), min(a, b)) gcd max(a, b) max a b min(a, b) min a b print(d, a * b // d) print d a * b // d a * b a b d def gcd(a, b):
    if a % b == 0:
        return b
    else:
        return gcd(b, a % b) def gcd(a, b):
    if a % b == 0:
        return b
    else:
        return gcd(b, a % b) gcd a, b = map(int, input().split()) map(int, input().split()) a b = map(int, input().split()) map(int, input().split()) b d = gcd(max(a, b), min(a, b)) gcd(max(a, b), min(a, b)) d
def gcd(a, b):
    if a % b == 0:
        return b
    else:
        return gcd(b, a % b)
while True:
    try:
        a, b = map(int, input().split())
        d = gcd(max(a, b), min(a, b))
        print(d, a * b // d)
    except:
        break