import fileinput as fi
def gcd_euler(a,b):
    if b == 0: return a
    u = a
    v = b
    r = u % v
    while True:
        if r == 0:return v
        u = v
        v = r
        r = u % v



if __name__ == "__main__":
    for line in fi.input():
        a,b = list(map(int,line.strip().split()))
        if a > b:gcd=gcd_euler(a,b)
        else:gcd=gcd_euler(b,a)
        print(gcd,int((a*b)/gcd)) import fileinput as fi fileinput def gcd_euler(a,b):
    if b == 0: return a
    u = a
    v = b
    r = u % v
    while True:
        if r == 0:return v
        u = v
        v = r
        r = u % v gcd_euler if b == 0: return a
     b == 0 b 0 u = a u a v = b v b r = u % v r u % v u v while True:
        if r == 0:return v
        u = v
        v = r
        r = u % v True if r == 0:return v
         r == 0 r 0 u = v u v v = r v r r = u % v r u % v u v a a b b if __name__ == "__main__":
    for line in fi.input():
        a,b = list(map(int,line.strip().split()))
        if a > b:gcd=gcd_euler(a,b)
        else:gcd=gcd_euler(b,a)
        print(gcd,int((a*b)/gcd)) __name__ == "__main__" __name__ "__main__" for line in fi.input():
        a,b = list(map(int,line.strip().split()))
        if a > b:gcd=gcd_euler(a,b)
        else:gcd=gcd_euler(b,a)
        print(gcd,int((a*b)/gcd)) line fi.input() fi.input fi input a,b = list(map(int,line.strip().split())) a list(map(int,line.strip().split())) list map(int,line.strip().split()) map int line.strip().split() line.strip().split line.strip() line.strip line strip split b if a > b:gcd=gcd_euler(a,b)
        else:gcd=gcd_euler(b,a)
         a > b a b print(gcd,int((a*b)/gcd)) print gcd int((a*b)/gcd) int (a*b)/gcd a*b a b gcd def gcd_euler(a,b):
    if b == 0: return a
    u = a
    v = b
    r = u % v
    while True:
        if r == 0:return v
        u = v
        v = r
        r = u % v def gcd_euler(a,b):
    if b == 0: return a
    u = a
    v = b
    r = u % v
    while True:
        if r == 0:return v
        u = v
        v = r
        r = u % v gcd_euler a,b = list(map(int,line.strip().split())) list(map(int,line.strip().split())) a b = list(map(int,line.strip().split())) list(map(int,line.strip().split())) b
import fileinput as fi
def gcd_euler(a,b):
    if b == 0: return a
    u = a
    v = b
    r = u % v
    while True:
        if r == 0:return v
        u = v
        v = r
        r = u % v



if __name__ == "__main__":
    for line in fi.input():
        a,b = list(map(int,line.strip().split()))
        if a > b:gcd=gcd_euler(a,b)
        else:gcd=gcd_euler(b,a)
        print(gcd,int((a*b)/gcd))