import sys
  
def gcd(m,n):
    return m if n==0 else gcd(n, m%n)

for m,n in [map(int,x.split()) for x in list(sys.stdin)]:
    g = gcd(m,n)
    print(g,(m//g)*n) import sys sys def gcd(m,n):
    return m if n==0 else gcd(n, m%n) gcd return m if n==0 else gcd(n, m%n) m if n==0 else gcd(n, m%n) n==0 n 0 m gcd(n, m%n) gcd n m%n m n m m n n for m,n in [map(int,x.split()) for x in list(sys.stdin)]:
    g = gcd(m,n)
    print(g,(m//g)*n) m n [map(int,x.split()) for x in list(sys.stdin)] g = gcd(m,n) g gcd(m,n) gcd m n print(g,(m//g)*n) print g (m//g)*n m//g m g n def gcd(m,n):
    return m if n==0 else gcd(n, m%n) def gcd(m,n):
    return m if n==0 else gcd(n, m%n) gcd g = gcd(m,n) gcd(m,n) g
import sys
  
def gcd(m,n):
    return m if n==0 else gcd(n, m%n)

for m,n in [map(int,x.split()) for x in list(sys.stdin)]:
    g = gcd(m,n)
    print(g,(m//g)*n)