def swap(a, b):
    a = a ^ b
    b = a ^ b
    a = a ^ b
def gcd(x, y):
    if(x < y):
        swap(x, y)
    mod = x % y
    if mod == 0:
        return y
    else:
        return gcd(y, mod)
def lcm(x, y):
    return x * y / gcd(x, y)
while True:
    try:
        (a, b) = map(int ,raw_input().split())
    except EOFError:
        break
    print gcd(a, b), lcm(a, b) def swap(a, b):
    a = a ^ b
    b = a ^ b
    a = a ^ b swap a = a ^ b a a ^ b a b b = a ^ b b a ^ b a b a = a ^ b a a ^ b a b a a b b def gcd(x, y):
    if(x < y):
        swap(x, y)
    mod = x % y
    if mod == 0:
        return y
    else:
        return gcd(y, mod) gcd if(x < y):
        swap(x, y)
     x < y x y swap(x, y) swap x y mod = x % y mod x % y x y if mod == 0:
        return y
    else:
        return gcd(y, mod) mod == 0 mod 0 return y y return gcd(y, mod) gcd(y, mod) gcd y mod x x y y def lcm(x, y):
    return x * y / gcd(x, y) lcm return x * y / gcd(x, y) x * y / gcd(x, y) x * y x y gcd(x, y) gcd x y x x y y while True:
    try:
        (a, b) = map(int ,raw_input().split())
    except EOFError:
        break
    print gcd(a, b), lcm(a, b) True try:
        (a, b) = map(int ,raw_input().split())
    except EOFError:
        break
     except EOFError:
        break
     break (a, b) = map(int ,raw_input().split()) (a, b) a b map(int ,raw_input().split()) map int raw_input().split() ().split () raw_input split print gcd(a, b) gcd a b lcm(a, b) lcm a b def lcm(x, y):
    return x * y / gcd(x, y) def lcm(x, y):
    return x * y / gcd(x, y) lcm def gcd(x, y):
    if(x < y):
        swap(x, y)
    mod = x % y
    if mod == 0:
        return y
    else:
        return gcd(y, mod) def gcd(x, y):
    if(x < y):
        swap(x, y)
    mod = x % y
    if mod == 0:
        return y
    else:
        return gcd(y, mod) gcd def swap(a, b):
    a = a ^ b
    b = a ^ b
    a = a ^ b def swap(a, b):
    a = a ^ b
    b = a ^ b
    a = a ^ b swap
def swap(a, b):
    a = a ^ b
    b = a ^ b
    a = a ^ b
def gcd(x, y):
    if(x < y):
        swap(x, y)
    mod = x % y
    if mod == 0:
        return y
    else:
        return gcd(y, mod)
def lcm(x, y):
    return x * y / gcd(x, y)
while True:
    try:
        (a, b) = map(int ,raw_input().split())
    except EOFError:
        break
    print gcd(a, b), lcm(a, b)