import sys
  
for m,n in [map(int,x.split()) for x in list(sys.stdin)]:
    g,r = m,n
    while r!=0:
      g,r = r,g%r
    print(g,m//g*n) import sys sys for m,n in [map(int,x.split()) for x in list(sys.stdin)]:
    g,r = m,n
    while r!=0:
      g,r = r,g%r
    print(g,m//g*n) m n [map(int,x.split()) for x in list(sys.stdin)] g,r = m,n g m r n while r!=0:
      g,r = r,g%r
     r!=0 r 0 g,r = r,g%r g r r g%r g r print(g,m//g*n) print g m//g*n m//g m g n g,r = m,n m g g,r = r,g%r r g r = r,g%r g%r r r = m,n n r
import sys
  
for m,n in [map(int,x.split()) for x in list(sys.stdin)]:
    g,r = m,n
    while r!=0:
      g,r = r,g%r
    print(g,m//g*n)