def GCD(m, n):
    while n:
        m, n = n, m % n
    return m

while True:
    try:
        a, b = map(int, input().split())
    except:
        break
    if a < b:
        a, b = b, a
    gcd = GCD(a, b)
    lcm = (a * b) // gcd
    print(gcd, lcm) def GCD(m, n):
    while n:
        m, n = n, m % n
    return m GCD while n:
        m, n = n, m % n
     n m, n = n, m % n m n n m % n m n return m m m m n n while True:
    try:
        a, b = map(int, input().split())
    except:
        break
    if a < b:
        a, b = b, a
    gcd = GCD(a, b)
    lcm = (a * b) // gcd
    print(gcd, lcm) True try:
        a, b = map(int, input().split())
    except:
        break
     except:
        break
     break a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b if a < b:
        a, b = b, a
     a < b a b a, b = b, a a b b a gcd = GCD(a, b) gcd GCD(a, b) GCD a b lcm = (a * b) // gcd lcm (a * b) // gcd a * b a b gcd print(gcd, lcm) print gcd lcm a, b = b, a b a b = b, a a b gcd = GCD(a, b) GCD(a, b) gcd lcm = (a * b) // gcd (a * b) // gcd lcm b = map(int, input().split()) map(int, input().split()) b def GCD(m, n):
    while n:
        m, n = n, m % n
    return m def GCD(m, n):
    while n:
        m, n = n, m % n
    return m GCD a, b = map(int, input().split()) map(int, input().split()) a
def GCD(m, n):
    while n:
        m, n = n, m % n
    return m

while True:
    try:
        a, b = map(int, input().split())
    except:
        break
    if a < b:
        a, b = b, a
    gcd = GCD(a, b)
    lcm = (a * b) // gcd
    print(gcd, lcm)