import sys
  
for s in sys.stdin:
    m,n = map(int,s.split())
    g,r = m,n
    while r!=0:
      g,r = r,g%r
    print(g,m//g*n) import sys sys for s in sys.stdin:
    m,n = map(int,s.split())
    g,r = m,n
    while r!=0:
      g,r = r,g%r
    print(g,m//g*n) s sys.stdin sys stdin m,n = map(int,s.split()) m map(int,s.split()) map int s.split() s.split s split n 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 n = map(int,s.split()) map(int,s.split()) n r = m,n n r r = r,g%r g%r r g,r = r,g%r r g m,n = map(int,s.split()) map(int,s.split()) m
import sys
  
for s in sys.stdin:
    m,n = map(int,s.split())
    g,r = m,n
    while r!=0:
      g,r = r,g%r
    print(g,m//g*n)