def gcd(u, v):
    if (v == 0): return u
    return gcd(v, u % v)

def lcm(u, v):
    return (u * v) // gcd(u, v)

while 1:
    try:
        inp = input()
    except EOFError:
        break
    else:
        u, v = inp.split(' ')
        u = int(u)
        v = int(v)
        print(gcd(u, v), lcm(u, v)) def gcd(u, v):
    if (v == 0): return u
    return gcd(v, u % v) gcd if (v == 0): return u
     v == 0 v 0 return gcd(v, u % v) gcd(v, u % v) gcd v u % v u v u u v v def lcm(u, v):
    return (u * v) // gcd(u, v) lcm return (u * v) // gcd(u, v) (u * v) // gcd(u, v) u * v u v gcd(u, v) gcd u v u u v v while 1:
    try:
        inp = input()
    except EOFError:
        break
    else:
        u, v = inp.split(' ')
        u = int(u)
        v = int(v)
        print(gcd(u, v), lcm(u, v)) 1 try:
        inp = input()
    except EOFError:
        break
    else:
        u, v = inp.split(' ')
        u = int(u)
        v = int(v)
        print(gcd(u, v), lcm(u, v)) except EOFError:
        break
     break inp = input() inp input() input u, v = inp.split(' ') u inp.split(' ') inp.split inp split ' ' v u = int(u) u int(u) int u v = int(v) v int(v) int v print(gcd(u, v), lcm(u, v)) print gcd(u, v) gcd u v lcm(u, v) lcm u v inp = input() input() inp def gcd(u, v):
    if (v == 0): return u
    return gcd(v, u % v) def gcd(u, v):
    if (v == 0): return u
    return gcd(v, u % v) gcd u, v = inp.split(' ') inp.split(' ') u u = int(u) int(u) u v = int(v) int(v) v v = inp.split(' ') inp.split(' ') v def lcm(u, v):
    return (u * v) // gcd(u, v) def lcm(u, v):
    return (u * v) // gcd(u, v) lcm
def gcd(u, v):
    if (v == 0): return u
    return gcd(v, u % v)

def lcm(u, v):
    return (u * v) // gcd(u, v)

while 1:
    try:
        inp = input()
    except EOFError:
        break
    else:
        u, v = inp.split(' ')
        u = int(u)
        v = int(v)
        print(gcd(u, v), lcm(u, v))