while True:
  try:
    a,b=map(int,input().split())
    if a<b:
      a,b=b,a
    s=b
    r=a%s
    while True:
      if r==0:
        G=s
        break
      else:
        s,r=r,s%r
    L=int((a*b)/G)
    print(G,L)
  except EOFError:
    break while True:
  try:
    a,b=map(int,input().split())
    if a<b:
      a,b=b,a
    s=b
    r=a%s
    while True:
      if r==0:
        G=s
        break
      else:
        s,r=r,s%r
    L=int((a*b)/G)
    print(G,L)
  except EOFError:
    break True try:
    a,b=map(int,input().split())
    if a<b:
      a,b=b,a
    s=b
    r=a%s
    while True:
      if r==0:
        G=s
        break
      else:
        s,r=r,s%r
    L=int((a*b)/G)
    print(G,L)
  except EOFError:
    break except EOFError:
    break break a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b if a<b:
      a,b=b,a
     a<b a b a,b=b,a a b b a s=b s b r=a%s r a%s a s while True:
      if r==0:
        G=s
        break
      else:
        s,r=r,s%r
     True if r==0:
        G=s
        break
      else:
        s,r=r,s%r
     r==0 r 0 G=s G s break s,r=r,s%r s r r s%r s r L=int((a*b)/G) L int((a*b)/G) int (a*b)/G a*b a b G print(G,L) print G L b=map(int,input().split()) map(int,input().split()) b b=b,a a b s=b b s s,r=r,s%r r s G=s s G a,b=b,a b a L=int((a*b)/G) int((a*b)/G) L a,b=map(int,input().split()) map(int,input().split()) a r=a%s a%s r r=r,s%r s%r r
while True:
  try:
    a,b=map(int,input().split())
    if a<b:
      a,b=b,a
    s=b
    r=a%s
    while True:
      if r==0:
        G=s
        break
      else:
        s,r=r,s%r
    L=int((a*b)/G)
    print(G,L)
  except EOFError:
    break
